Wednesday, April 8, 2009

Setting Up an iMIS Testing Database

I support more than one iMIS installation therefore being able to setup a testing copy of iMIS quickly is important to our project progress. In many situations you need a recent copy of production data setup on a testing database.

The details of setting up a testing application server and installation are for another posting. This overview assumes you already have testing infrastructure in place.

Here is the quickest and most reliable method I know to create get a testing database setup.

/*

Name: iMIS Testing Database Setup
Author: Travis Dunbar
Date: November 6, 2008
UpdatedL April 8, 2009

Purpose: To quickly update a testing database without having to login and manually change settings.

Assumptions:
- The production and testing versions of iMIS (15.0.3.2289) are already setup
- SQL Server 2005

Steps:
- Create a SQL backup of your iMIS database
- Move the backup file to the testing database server
- Restore database on testing server; I had to stop my iMIS application server to do the restore, the app server automatically creates a connection to the database
- Login to iMIS DB Repair Utility
- Connect to the testing server and testing database
- Run "Prepare iMIS Database" and "Reset All Permissions" functions
- Run the script below in SQL Server Management Studtio


Now users can login to the testing copy of production, quickly identify they are in the testing copy, and even submit testing credit card payments.

*/

UPDATE CCAuthAcct
SET CCAuthURL='test-payflow.verisign.com'
WHERE CCAuthURL = 'payflowpro.verisign.com'
--select * from ccauthacct WHERE CCAuthAcctDescription='YOUR ACCOUNT NAME'

UPDATE SYSTEM_PARAMS
SET SHORTVALUE='###### iMIS TEST DATABASE ###### RESTORED: ' + CAST(getdate() AS CHAR(12))
WHERE PARAMETERNAME='System_Control.SystemName'
-- select * from SYSTEM_PARAMS WHERE PARAMETERNAME='System_Control.SystemName'

No comments: