Moving PremiSys Databases onto a new SQL server
Moving PremiSys Databases onto a new SQL server
Two instruction sets are explained in this article to move a SQL database
- Performing a SQL backup to be restored onto the new SQL Server.
- Detaching the SQL databases from the old SQL server, then copying and attaching the databases on the new SQL Server.
*Please read the entire procedure before you begin. If you have any questions, consult your SQL Admin or call PremiSys Tech Support.
NOTE: Microsoft SQL Server Management Studio will be needed to move the databases
Performing a SQL backup to be restored onto the new SQL Server
- 1. Log into the current SQL instance using SQL Server Management Studio with either the sa account login or an account that has sa rights.
- Expand the database folder showing the available SQL databases.
- Right click on the Premisys Database and hover over the tasks option.
- This will open the tasks menu where you will see the backup option, select it.
- Click OK to run the Backup.
- A successful message will appear as shown below, click ok.
- Repeat steps 3-6 for the Cardholders database.
NOTE: Unless the path has been changed the backups will be located in the at the location below saved as premisys.bak and cardholders.bak.
C:\Program Files\Microsoft SQL Server\MSSQL10_50.IDENTICARD\MSSQL\Backup
Restoring SQL Backups of the Databases onto the new SQL Server
- Copy the backed up database files to the desired new location. (The new path must be local to the new SQL service.)
- Connect to the current SQL instance using either the sa account login or an account that has sa rights.
- Right click on the Databases folder and select Restore Database.
- Select from Device and browse to the square control with three dots.
- Click the Add button to browse to the Premisys backup file.
- Click Ok, Ok, and Ok again to start the restore.
- Once the restore is complete repeat steps 3-5 for the Cardholders backup file.
- You will need the appropriate ChangeApplicationOwnedTablestoDBO.sql. For this, contact your certified Premisys integrator.
- In SQL Management Studio click File > Open > File and browse to the file you saved above. You may have to re-enter your SQL credentials.
- Toward the end of the script you need to type in the name of the computer running the "IDenticard Windows Service" service and the name of the IIS server.
- Click the Execute button to run the script. If you see any errors below in red, run it a second time. If it runs without errors, the databases are good
- Now you will need to update the localConfigV2.config file on the Server and any connected client.
- Open the C:\Program Files\IDenticard\LocalConfigV2.config file in Notepad. You will need to change three lines in this file: SystemDB_Server, CardholdersDB_Server, and LookupDB_Server. (See highlighted below on where to make the changes.
- <LocalConfig>
<ArrayOfEntry>
<add key="CardholdersDB_Server" value="PCName\Instance"/>
<add key="CardholdersDB_Database" value="Cardholders"/>
<add key="CardholdersDB_UserName" value="pDfmqf2QeGLorbWLKor1mw=="/>
<add key="CardholdersDB_Password" value="qnkBzJDgADBCnuR83Z/U5hHqiq
+YKr+r9t5TqWq9iWw="/>
<add key="SystemDB_Server" value=" PCName\Instance "/>
<add key="SystemDB_Database" value="PremiSys"/>
<add key="SystemDB_UserName" value="pDfmqf2QeGLorbWLKor1mw=="/>
<add key="SystemDB_Password" value="qnkBzJDgADBCnuR83Z/U5hHqiq+YKr
+r9t5TqWq9iWw="/>
<add key="LookupDB_Server" value=" PCName\Instance "/>
<add key="LookupDB_Database" value="PremiSys"/>
<add key="LookupDB_UserName" value="pDfmqf2QeGLorbWLKor1mw=="/>
<add key="LookupDB_Password" value="qnkBzJDgADBCnuR83Z/U5hHqiq
+YKr+r9t5TqWq9iWw="/>
<add key="CheckLicensing" value="false"/>
<add key="RememberUsername" value="true"/>
<add key="LaunchProductionUI" value="true"/>
<add key="ServerOnly_ServicesServerHost" value="AppServerName"/>
<add key="DatabaseReadConfigValueRetries" value="3"/>
- <LocalConfig>
- Save the file and restart the Identicard Windows Service. Once the service is started log into Premisys. The data is now connected to new SQL server instance.
- The easy way to update the client PCs is to take the updated config file from the server and copy it to all the client machines.
NOTE: The following only needs to be done on a Premisys System not PremisyID
The last step is to change two text files in the Inetpub folder on the IIS server (usually the same PC as the service server). The first is located at C:\Inetpub\wwwroot
\IDenticard\web.config, and you need to edit the DB server name on the same three lines, almost exactly like you would in the LocalConfig file. The second file is located at C:\Inetpub\wwwroot\IDenticard\Services\web.config and needs pretty much the same edit.
Detaching and Moving Databases to a New SQL Server Location
- Log into Microsoft SQL Server Management Studio.
- Expand the SQL Server and the databases.
- Right click on the Premisys Database and select tasks, then select detach.
- Repeat step 4 for the Cardholders database.
- Browse to C:\Programs Files\Microsoft SQL Server\MSSQL12IDenticard\MSSQL\DATA folder where you will find the 4 files you need; premisys.mdf, premisys_log.ldf, cardholders.mdf, and cardholder_log.ldf.
- Copy those 4 files and move them to the new PC that is going to house the SQL Server.
- On the new PC log into Microsoft SQL Server Management Studio.
- Right click on the databases folder and select Attach.
- Click the add button and browse to the location of those 4 files and select the Premisys.mdf file then click Ok.
- Repeat steps 9-10 for the Cardholders Database.