Database Creation - Margin Master

Margin Master Handbook

Introduction
Part I · Installing
Part II · Introducing the Main Window
Part III · Initial Configuration
Part IV · Customizing the Workspace
Part V · Basic Application Functionality
Part VI · Learning Margin Master
Part VII · Advanced Topics
Part VIII · Updates, Troubleshooting & Help
Appendix
Part I · Chapter 4 — Your DatabaseUpdated 2026-08-27

Database Creation

What is this?

Database Creation is a guided feature that walks you through creating a new Margin Master database from within the application. The Create New Database dialog collects your store information, auto-generates a database name, validates your license, and then builds the full database -- schema, tables, and initial configuration -- in a single step.

Walk through it in the app: guide 1002 — Creating a new database. Margin Master can walk you through these steps live: turn on Training / Guide Mode from the Help menu, then type 1002 into the Lessons & Guides box — or ask Margin Master support to run it with you.

Key Capabilities

  • Dedicated dialog -- a focused form collects store number, vendor, POS system, and RSC
  • Auto-generated database name -- the name is built from your store info (e.g., Ace_9475_KingHardware_Paladin) and checked for conflicts in real time
  • License validation -- your store license is verified before creation proceeds
  • Automatic schema creation -- tables are created via EF Core migrations, tailored to your vendor and POS system
  • Seed data -- three system tables are automatically populated with your store configuration
  • Schema verification -- automated post-creation validation ensures the database matches the expected model
  • Auto-switch -- the application reconfigures to the new database immediately after creation
  • Settings transfer prompt -- after creation, offers to copy settings from an existing database so you don't have to re-enter them

Who is this for?

  • New users setting up Margin Master for the first time
  • Existing users who need a second database (e.g., a test or training database)
  • Support staff helping customers configure a fresh installation or troubleshoot by creating a clean database

How to Access

There are two ways to create a new database:

  1. From the Database Setup window -- Click the "Create New Database" button (or File > Create New Database from the menu). This is the typical path on first launch.
  2. From the main application -- Go to File > Database > Create Database. This opens the Create New Database dialog directly, bypassing the setup window.

Both paths open the same Create New Database dialog.

The Create New Database Dialog

Create New Database: Store Information, Database Name, License Validation

This dialog has three sections:

Store Information

Field Description
Primary Vendor Select your primary vendor (Ace Hardware, Do it Best, Orgill, etc.)
Store Number Your store number (4+ digits). Validated against the cloud API -- internet required. A green checkmark appears when validated.
Store Name Populated automatically from the cloud API after store number validation. Can be edited manually.
RSC (Retail Support Center) Only shown for Ace Hardware and Orgill vendors. Select your warehouse/distribution center.
Point of Sale System Select your store's POS system (Epicor, Paladin, RockSolid, Transact, etc.)

A status message below the store fields shows validation progress and results.

Database Name

The database name is auto-generated from your store information in this format:

{VendorShort}_{StoreNumber}_{StoreName}_{PosShort}

For example: Ace_9475_KingHardware_Paladin

  • If the name already exists on the server, a suffix is appended automatically (-1, -2, etc.)
  • You can edit the name manually at any time
  • A status indicator shows whether the name is available (green) or already exists (red)

License Validation

A valid license is required before you can create a database.

  1. Fill in all store information above
  2. Click "Validate Store & License"
  3. The system contacts the Margin Master licensing server
  4. On success, a green checkmark and expiration date appear
  5. The "Create Database" button becomes enabled

Note: License validation requires an internet connection. If store information changes after validation, the license resets and must be re-validated.

Action Buttons

Button Description
Create Database (green) Creates the database. Only enabled when all fields are complete, store is validated, name is available, and license is validated.
Cancel (gray) Closes the dialog without creating anything.

What Happens After You Click "Create Database"

The application creates your database in six steps, showing progress on the splash screen:

Step Action Details
1 Check Existence Query sys.databases to ensure the name is available
2 Create Empty DB Create .mdf (100 MB) and .ldf (10 MB) files; set RECOVERY SIMPLE, AUTO_CLOSE OFF
3 EF Core Migrations Apply code-first schema; vendor-specific tables (e.g., AceCatalogRecords for Ace only)
4 Seed Data Populate About, GlobalFileConfig, ApplicationSettings with store configuration
5 Verify Schema Compare database against EF Core model -- tables, columns, types, indexes, foreign keys
6 Write Log Persist detailed creation log with timings and results

After creation, the application:

  1. Saves the connection to DatabaseConnections.json and sets it as active
  2. Reconfigures to the new database (updates connection string, clears caches)
  3. Offers to copy settings from an existing database if one exists

Common Questions

Q: What store information do I need? A: Your store number, primary vendor, and POS system type. The store name is fetched automatically from the API.

Q: What if my store number isn't found? A: Verify you entered the correct store number for your vendor. Contact Margin Master support if the store is new or not yet registered.

Q: Can I change the database name? A: Yes. The auto-generated name is editable. Just type your preferred name in the field.

Q: What if the name already exists? A: The auto-generation adds a suffix (-1, -2, etc.) automatically. You can also type a different name manually.

Q: Do I need an internet connection? A: Yes, for two reasons: (1) store number validation against the cloud API, and (2) license validation with the Margin Master licensing server.

Connect with us

Margin Master by RetailerSoft, Inc. © 2026. All rights reserved.

Loading...

Reconnecting to the server...

This usually takes a few seconds.