SalesLogix Test and Production Databases on one Connection Manager

In most cases the test database you are using is a copy of the production database and it is installed in a separate test environment.  If you are using the same SalesLogix Connection Manager for both the test and production databases then we need to change the site code and primary server code of the test database to prevent possible data issues.  Please run the following script against the Test database.


/*
This script will change the primary site code of a SLX database.
Run the script via MSSQL Query Analyzer. This should be done
when a test database is created by restoring a backup of a
production database and the same SalesLogix server is being
used for both databases. If the primary site code remains the
same for both databases cross-pollination of Queue files and
TEF files may occur.


                             * * CAUTION * *


                  * * CAUTION * *      * * CAUTION * *
Make sure you are not pointing at your production database when you run this.
*/


DECLARE @OLDSITECODE AS CHAR(4);
DECLARE @NEWSITECODE AS CHAR(4);
DECLARE @OLDPRIMARYSERVER AS CHAR(4);
DECLARE @NEWPRIMARYSERVER AS CHAR(4);
/* Get the old Site Code & Primary Server */
SET @OLDSITECODE = (SELECT SITECODE FROM sysdba.SYSTEMINFO WHERE SYSTEMINFOID = ‘PRIMARY’)
SET @OLDPRIMARYSERVER = (SELECT PRIMARYSERVER FROM sysdba.SYSTEMINFO WHERE SYSTEMINFOID = ‘PRIMARY’)
/* Change the following value to the site code to use. */
SET @NEWSITECODE = ‘XXSC’
SET @NEWPRIMARYSERVER = ‘XXPS’
UPDATE sysdba.SYSTEMINFO
SET SITECODE = @NEWSITECODE
WHERE SITECODE = @OLDSITECODE
UPDATE sysdba.SYSTEMINFO
SET PRIMARYSERVER = @NEWPRIMARYSERVER
WHERE PRIMARYSERVER = @OLDPRIMARYSERVER
UPDATE sysdba.BRANCHOPTIONS
SET SITECODE = @NEWPRIMARYSERVER
WHERE SITECODE = @OLDPRIMARYSERVER
UPDATE sysdba.SITEKEYS
SET SITECODE = @NEWSITECODE
WHERE SITECODE = @OLDSITECODE
UPDATE sysdba.SITEOPTIONS
SET SITECODE = @NEWSITECODE
WHERE SITECODE = @OLDSITECODE
UPDATE sysdba.SITEOPTIONS
SET SITECODE = @NEWPRIMARYSERVER
WHERE SITECODE = @OLDPRIMARYSERVER
UPDATE sysdba.SITEOPTIONS
SET HOSTSERVER = @NEWPRIMARYSERVER
WHERE HOSTSERVER = @OLDPRIMARYSERVER
UPDATE sysdba.SYNCFILETRACKING
SET SOURCESITE = @NEWPRIMARYSERVER
WHERE SOURCESITE = @OLDPRIMARYSERVER
UPDATE sysdba.SYNCFILETRACKING
SET TARGETSITE = @NEWPRIMARYSERVER
WHERE TARGETSITE = @OLDPRIMARYSERVER
UPDATE sysdba.SYNCSEQUENCING
SET SOURCESITE = @NEWSITECODE
WHERE SOURCESITE = @OLDSITECODE
UPDATE sysdba.SYNCSEQUENCING
SET TARGETSITE = @NEWSITECODE
WHERE TARGETSITE = @OLDSITECODE
UPDATE sysdba.SYNCSEQUENCING
SET SOURCESITE = @NEWPRIMARYSERVER
WHERE SOURCESITE = @OLDPRIMARYSERVER
UPDATE sysdba.SYNCSEQUENCING
SET TARGETSITE = @NEWPRIMARYSERVER
WHERE TARGETSITE = @OLDPRIMARYSERVER
UPDATE sysdba.SYNCSERVER
SET SITECODE = @NEWPRIMARYSERVER
WHERE SITECODE = @OLDPRIMARYSERVER
UPDATE sysdba.SYNCSERVER
SET MAINSERVER = @NEWPRIMARYSERVER
WHERE MAINSERVER = @OLDPRIMARYSERVER
GO

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!