Installing Additional Instances of METRIX on a Single Computer
Added by Anthony Hernandez, last edited by Anthony Hernandez on Aug 28, 2006  (view change)
Labels:

# Installing Additional Instances of Metrix on a Single Computer

If you are a Metrix consultant or developer, you may find it necessary to have more than once Metrix database on your computer at the same time. For example, if you are customizing Metrix for more than one client simultaneously, you will need to have one Metrix installation for each client.

To install multiple versions of Metrix on your computer, you will:

• Backup a default version of the "back-end" Metrix database.
• Restore that backup to your MSDE/SQL Server under a new database name.
• Copy the default Metrix front-end and customization files to a new directory.
• Connect these duplicate files to your new Metrix backend.
• Customize as necessary.

To backup and restore the backend files, you will use a text-based utility called osql.exe for interacting with your MSDE/SQL Server. (This utility is installed with MSDE. Alternatively, you can use SQL Server's Enterprise Manager utility, if you have a full version of SQL Server installed.) You will perform the rest of the procedure using Microsoft Windows and Microsoft Access.

Note: The paths and filenames below may vary, depending on how MSDE/SQL Server is installed on your computer. If you encounter errors, browse your computer's file system to locate the correct file paths for your computer.

Here is a detailed explanation of the process, using osql.exe:

1. Backup the default "backend" Metrix database. You will use this database as a foundation for the database you are customizing for the client. To do so:
• Enter the "DOS command line" mode of Windows by choosing Run from your computer's Start menu and typing command into the dialog box.
• At the DOS prompt, start OSQL and connect to your MSDE/SQL Server by typing:
OSQL -U sa -P yourPassword -S (local)\Metrix

Where sa is the username of an administrator for this MSDE/SQL Server installation, and yourPassword is the password for that user. If you are accessing the server from a computer other than the one on which the server is installed, replace (local) with the name of the server.

• Enter this command:
BACKUP DATABASE dbname TO DISK = 'c:\path\to\backupfile.dat'

Where dbname is the name of the database you are backing up (by default this will be something like "MetrixV130"), and c:\path\to\backupfilename.dat is the full path to the backup file you are creating. Make a note of this location because you will need it later when you restore this file to the database server.
Note: If you do not know the name of your existing Metrix database, open Metrix using the Shift bypass Technique and choose "Connection" from the File menu.

Verifying the Name of the Metrix Database

The database name will appear in the "Select the database on the server..." dropdown box.

• To execute the command, type "go." If there are no errors, your Metrix database will be backed up to the file name you specified.
2. To create the new database on your database server, use OSQL to restore the backup file you just created:
• Enter this command at an OSQL prompt:
RESTORE DATABASE newdb FROM DISK = 'c:\path\to\backupfile.dat' WITH MOVE 'UpRunningSQL_dat' to
'c:\Program Files\Microsoft SQL Server\MSSQL$Metrix\Data\MetrixV120copy.mdf', MOVE 'UpRunningSQL_log' to 'c:\Program Files\Microsoft SQL Sever\MSSQL$Metrix\Data\MetrixV120copy.ldf'

where:

• c:\path\to\backupfile.dat is the full path to the file you created during the backup procedure above.
• 'c:\Program Files\Microsoft SQL Server...' is the path to your MSDE/SQL Server installation.
• MetrixV120copy.ldf is the new name of the log file for the database you created during the backup procedure above.
• MetrixV120copy.mdf is the new name of the data file for the database you created during the backup procedure above.
• Type "go" to execute the command. If no errors occur, OSQL will respond with a message indicating the database restoration was successful.
• To exit OSQL, type "exit" at an OSQL prompt. To exit DOS mode, type "exit" at a DOS prompt.
Note: You may find it easier for new installations to create a new database on the server instead of over-writing the existing one. To do this, use this command instead of the one in step 2a above:
RESTORE DATABASE newdb FROM DISK = 'c:\path\to\backupfile.dat'

where newdb is your chosen name for the database you are installing. Metrix_organizationname is an appropriate choice (where organization_name is the name of the organization using Metrix). If you use this technique, remember to connect your three .adp files to the correct database (see below).

3. Since custom tables, forms, and reports are stored in interactsql.adp and reportsql.adp, you must duplicate each of these files for your new Metrix installation.
• Find interactsql.adp and reportsql.adp on your computer. They will be in the directory you specified during the original Metrix installation process. The default location is C:\Program Files\fcny\Metrix\Server.
• Use Windows' copy-and-paste functions to duplicate these files, placing the copies in an appropriately-named folder that describes their purpose. For example, if you are customizing Metrix for the Association for Animal Rights, you could put them in a directory called "AAR".
Figure: Connecting to the new Metrix backend database
4. Configure the new interactsql.adp and reportsql.adp files to use the new backend database you created in step 2 above. For each file:
• Open the file.
• From the File menu, choose Connection....
• Choose or enter the correct server name in step 1, and click Refresh.
• Choose the name of the new database from the drop-down list, making sure to enter the correct username and password.
• Click Test Connection to make sure the database connection is valid.
• Click OK to save changes.
• Close the file. In the dialog that pops up, approve saving of your password.
5. Use Windows' copy-and-paste functions to duplicate the core Metrix program files. By default, these can be found in c:\Program Files\fcny\Metrix. Place them in an appropriately-named folder that describes their purpose. For example, if you are customizing Metrix for the Association for Animal Rights, you could put them in the directory called c:\Program Files\fcny\Metrix\clients\aar.
Figure: Adding references to custom builds
6. Customize the new Metrix.adp file so it connects to the new Metrix backend and the new interactsql.adp and reportsql.adp files:
• Open the new Metrix.adp using the shift-bypass function (see Shift Bypass Technique).
• From the File menu, choose Connection....
• Choose the name of the new database from the drop-down list, making sure to enter the correct username and password, then click Refresh.
• Click Test Connection to make sure the database connection is valid. Click OK to save and close.
• In the database window, go to the Forms tab. Click once on any form to select, and open the Code window.
• From the Tools menu, choose References.
• Un-check interactsql.adp and reportsql.adp , and close the References window, then re-open it.
• Click Browse. Find the copy of interactsql.adp you created in the procedure above, and click OK.
Note: Make sure to choose your new interactsql.adp file, not the one that was originally installed by Metrix.
• Click Browse again. Find the copy of reportsql.adp you created in the procedure above, and click OK.
• In the References dialog box, click OK to close it.
• To begin using your newly customized Metrix installation, close and re-open Metrix.adp.

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.