Knowledge Base

Create a Test Database from Live Database

Updated on

A testing or training database can be created for [i]merchant.  

This is a handy tool for trying out new features, testing new releases, or training users. 

A testing database can be created in three steps:

  1. Make a backup of the existing [i]merchant database.
  2. Restore the backup as the testing database.
  3. Configure the [i]merchant clients to use the testing database.

Below are the details of each step.

For SQL Server 2005

Backup Current [i]merchant database

The Backup and restore steps should be run by a SQL Server administrator on a PC that can administer SQL Server.  

The PC used to apply [i]merchant updates to the database is an acceptable machine, typically this is the Server PC.

  • Click Windows Start Button
  • Select All Programs
  • Select Microsoft SQL Server 2005 (name may vary)
  • Select SQL Server Management Studio
  • Fill out the connect to Server dialog and press Connect.
    • Server Type = Database Engine
    • Server  = the database instance. The name should appear in the drop down list. The default name is PCNAME\imerchantsql.
    • Authentication type = SQL Server Authentication.
    • Login /Password = These are the same credentials used when applying a database update to [i]merchant.
  • Expand the Object explorer on the left side of the screen,.
  • Expand the SQL server instance that has the [i]merchant database. There should be the only instance which matches the Server name used above.
  • Expand the “Databases” branch. Here you should find the [i]merchant database listed. Depending on your system, other databases may be present.
  • Right click in the [i]merchant database.
  • Select “Tasks”
  • Select “Backup Database…” and a dialog box will appear showing the database information and some settings.
  • Make sure the correct database has been selected.
  • Set Backup type to” Full”
  • Choose the “Database” radio button in the backup component section.
  • In the Destination section, remove all the entries that are present. This is a list of previous backups.
  • Make sure the “Disk” radio button is selected.
  • Now that the list is empty Select “Add”. The “Select Backup Destination dialog box will appear.
  • Select the “File name:” option.
  • Browse and/or enter a file location to put the backup image. Make the name clear, and end it with a .bak extension.  For Example: imDB_ForTesting_mmddyy.bak.
  • Select the “Options page on the top left portion of the screen.
  • Select Overwrite existing media in the overwrite section.
  • Leave the remaining portion unchanged. .
  • Click “OK” and the backup will begin.
  • A message will appear indicating the backup is complete, Press OK to close the form.

Restore the Backup image into a Testing Database.

  • Determine a name for the testing database, for example imTesting.
  • If a testing database was already created, and you want to recreate it, the old version should be deleted.
    • Right click on the imTesting database and select Delete.
    • A confirmation dialog will appear.
    • Check the box to delete the history and backups.
  • On the “Databases” branch of the tree right click.
  • Select “Restore Database…” and the Restore Database dialog box will appear showing the database information and some settings.
  • Enter the name you will use for this database, imTesting for this example.
    • Warning!-  if you use the dropdown list, or select a name that already exists that database will be overwritten!
  • In the Restore section Choose the “From Device” radio button.
  • Click on the “Select Devices” button and the “Restore Devices” form appears.
  • Select the “From Disk” radio button.
  • Click the “Add…” button in the restore from section. This will bring up the “Choose Restore Destination” form.
  • Browse to find the backup file created in the backup section above.
  • Select “OK” twice to end the “Choose Restore Devices” form.
  • Now the lower portion of the Restore form will be enabled.
  • Choose Backup Set 1 with the check box.
  • Select the Options tab.
  • Under the Restore Options section check the Overwrite the existing database option.
  • The “Restore database files as:” section will be filled in with file locations for the testing database.
  • Keep the defaulted logical file names.
  • In the “Restore As” column, validate the file location path and file name for both the Data and log files for the database. These should default properly, but it is important to validate the file locations.
    • The default location for the files is determined by SQL Server, but this location can be changed for each database. Usually this is pointing to a folder called “C:\Program Files\Microsoft SQL Server\MSSQL\data\”.
    • The actual file name is usually the same as the database name, suffixed with “_Data.MDF” for the data portion and “_Log.LDF” for the log file portion.
    • Ensure these names are unique for this database. Choosing a file name that already exist will over write data and potentially causes data loss or corruption.
    • For this example the file name would be imTesting_Data.MDF for the data file and imTesting_Log.ldf for the log file.
  • Keep the default Recovery completion state of “Leave database operational.”
  • Select OK to restore and create the testing database.
  • The database is restored, exit SQL Server Management Studio.

Configure the [i]merchant clients to use the testing database.

The [i]merchant connection manager program will be used to configure and launch the testing database. 

When a test system is installed on a PC caution needs to be taken to ensure the user is aware of the database being used. 

After a test database is created, it is advisable to change some settings to make it obvious that an alternate database is being used. 

Some areas to be concerned with are:

  • Users and Permissions. Consider using alternate user names or passwords so that logging into the test data is a conscious effort.
  • Use a Background image in [i]merchant to distinguish the test system from the live system.
  • Alter, disable or invalidate settings used to interface with other systems. Accounting, EDI, and credit card authorization are some examples of systems that should be altered. Failure to do so can place the test database transactions into the live systems. When possible set up a test version of these systems.
  • Avoid using the connection manager when launching the live system. Although [i]merchant runs fine, this discipline will help to prevent an accidental launch of the wrong database.
  • Do Not run both the live system and the test system at the same time. The PC and [i]merchant will keep the tasks separate, but you will not.

Client PC Setup

This step needs to be performed on each PC that will use the testing system.

  • Launch the connection manager program using the Windows Run command.
    • Click the Windows Start button.
    • Click Run.
    • Click Browse.
    • Drill down to the [i]merchant install folder, typically “C:\Program Files\Computac Inc\[i]merchant”.
    • Select “Connection Manager” and Press “Open”.
    • Click “OK”.
    • Note: A shortcut can be added to allow easy launch of the connection manager.
  • Connection manager will start with the “Default” connection in the Connection Name field.
  • Change the connection Name to a new name indicating the test system. For example “[i]merchant Test Database”.
  • Change the Database name to the name given to the testing database,  imTesting in this example.
  • Remove any entry in the POS Server field.
  • The other fields, User ID, Password, and Server Name should be left alone.
  • Click “Test Connection” to make sure this is configured properly.
  • Once the connection tests successfully, click “Save Connection”.  This will create and save a connection named “[i]merchant Test Database”, or whatever was entered.
  • This PC is now configured to run and use the testing database.
  • Click the “Launch [i]merchant” button to run the test system. Modify interface settings as suggested above.

Run from Testing Database

Recommended Method:

The [i]merchant connection manager program allows [i]merchant to be run from any database. 

The database selected must match the version of [i]merchant being run, if it does not an error message or update prompt will be displayed. 

A separate article is available for running multiple version of [i]merchant on a single PC.

  • Launch the connection manager program using the Windows Run command or a short cut.
  • Connection manager will start with the “Default” connection in the Connection Name field.
  • Change the connection Name to a new name indicating the test system. Use the dropdown list to select from the existing names.
  • Click the “Launch [i]merchant” button to run from the selected system.
  • Note: when running form an alternate location, the database connection name will appear on the bottom of the login form.

Alternate Method:

The [i]merchant login form allows the connection to be changed prior to logging in. 

While this is an acceptable method of choosing a connection, it tends to be more confusing.

  • Launch [i]merchant normally.
  • From the Login form, press the Control, Shift, and F5 keys down at the same time.
  • The Bottom of the login form will open up a dropdown list for selecting the database connection.
  • Choose the connection desired.
  • Complete the login form.
Previous Article Picking Items for Open Customer Orders
Next Article Install SQL Express
Still Need Help? Contact Us