How to move an existing Altiris NS 6.x database from one SQL server to a new SQL server

Article:HOWTO2574  |  Created: 2006-03-01  |  Updated: 2010-07-21  |  Article URL http://www.symantec.com/docs/HOWTO2574
Article Type
How To



Problem
The Notification Server needs to be moved to a new SQL server. How do you move an existing Altiris database to a new SQL server?

Environment
Notification Server 6.0
MS SQL Server 2000

Cause

SQL server hardware is being upgraded

Resolution

Disclaimer: The following steps are provided as reference. Questions or concerns or for more details about how to migrate a database from a SQL Server, please contact Microsoft.

Note: For steps for how to move/migrate the Altiris Database from a SQL Server 2000/2005 to another SQL Server 2005, please see Article ID: 40605 "How to move an existing Altiris database from one SQL server to a new SQL server 2005"



There are two ways that you can take to approach this issue:
  1. Backing up your Notification Server and then moving the backup to the new SQL server.
  2. Detaching the Altiris database from the old SQL server and attaching it to the new SQL server.

Option 1: Using a Backup file

If you choose to move the backup file to the new SQL server (option 1), follow these steps:

  1. To backup database:
    1. Launch SQL Enterprise Manager.
    2. Locate your current server and open the Database folder.
    3. Right-click on the database you want to move and select Properties.
    4. Make note of the database Collation on the General Tab
    5. Right-click on the database and select All Tasks > Backup Database.
    6. The SQL Server Backup Dialog appears. Make sure that under Backup, Database-Complete is marked.
    7. Under Destination, click the Add button.
    8. The Select Backup Destination dialog appears. In the Filename field, browse to the path where to place the backup database file.
    9. Click OK.
    10. Repeat steps e-i for the Altiris_Incidents database used for Alert Manager and Helpdesk.
  2. To restore database:
    1. On the new SQL server, Launch SQL Enterprise Manager
    2. Right-click on the "Master" database and select Properties.
    3. Make sure that the Collation of the master database is the same as the database you are going to restore.
      In order for NS to function both the Master and Altiris databases must have the same collation (collations cannot be changed on established databases)
    4. Move or copy the backup file to the new location on the new SQL server.
    5. Under the new server name, right-click on the Databases folder.
    6. Select All Tasks>Restore Database.
    7. The Restore Database Dialog appears. Select the database name or enter the database name that you would like to restore the backup database as in the Restore As Database field. Example: Altiris Database.
    8. Mark the <From Device> radio button by Restore.
    9. Under Parameters, click the Select Devices. The Choose Restore Devices dialog appears.
    10. Under Restore From, click the Add button to browse for the backup database file and click OK.
    11. Click OK to close the Choose Restore Devices dialog.
    12. Switch to the Options tab and make sure the restore path of the data file(s) and log file(s) is a valid path
    13. Back on the Restore Database dialog, make sure that the Database-Complete option is marked.
    14. Click OK to begin the restore and close.
    15. Repeat steps d-m for the Altiris_Incidents database
Option 2: Detaching/Attaching

If you choose to detach the Altiris database from the old SQL server and attach it to the new SQL server (option 2), follow these steps:

Note: Additional Notes can be found here: http://support.microsoft.com/default.aspx?scid=kb;en-us;224071
Please also note that the steps below are for SQL 2000 only.
  1. Detaching the database files:
    1. Make sure that you have a current backup of all of the databases you are planning to move.
    2. Stop all of the Altiris Services. These are found on the NS server, by clicking Programs > Administrative Tools > Services, and stopping all of the Altiris-related services.
    3. Launch SQL Enterprise Manager
    4. Right-click the database you want to move and select Properties.
    5. Make note of the database Collation on the General Tab
    6. Choose All Tasks > Detach Database.
    7. Verify that current connections are at 0. If not, clear all connections, by clicking the Clear Connections button.
    8. Once that is completed, browse to the existing database location in the file system.
    9. Grab both the .MDF file and the .LDF files for the databases you would like to move, and move or copy to the desired location on the new SQL server.
  2. Attaching the Database files:
    1. Open SQL enterprise Manager on the new SQL server
    2. Right-click on the "Master" database and select Properties.
    3. Make sure that the Collation of the master database is the same as the database you are going to restore.
      In order for NS to function both the Master and Altiris databases must have the same collation (collations cannot be changed on established databases)
    4. Right-click on the Databases folder.
    5. Select All Tasks > Attach Database.
    6. Make sure the database has the same names.
    7. Specify that the database owner (DBO) to be the same SQL account as was used when the NS was installed.
    8. Click OK.
    9. Restart the Notification Server services.


If the database is simply being moved from one database server to another, and the Notification Server has not changed etc then simply do the following 5 steps:

1. Open Regedit on the Notification Server and go to HKLM\Software\Altiris\eXpress\Notification Server

2. Modify the "DBDsn" string value in the right colum.  Look for the separated value: SERVER= and change it to the name of the server and the instance the database resides in.   Verify that the DATABASE= tag reflects the correct name of the restored database.

  If the database is in the default instance then just put the name of the database server. If the database is in a named instance then specific the instance.
 
  Examples:
 SERVER=ServerName;   {If the database is in the default instance}
 SERVER=ServerName\Instance {If the database is restored in a named instance}
 

3. Using Notepad++ or a text editor capable of editing xml files without stripping out certain xml tags edit .\Program Files\Altiris\Notification Server\Config\CoreSettings.config
  
   Search for "DbServer" and change the name in the value tag has the name and instance of the new database server.
   Search for "DbCatalog" and verify that the name specified in the value is the same name as the database as it was restored on the new DB server.

4. Verify that the database access\logon account used by the NS has rights to the database on the new server. It should have dbo.

5. Restart the Altiris Service


If there are problems where the console cannot be accessed or other issues then running NSSetup may be required.

Running NSSetup

    Important Note:: Do Not Run NSSetup on an NS 7 Database. See KB 40605 For information on moving NS 7 Databases


After you finished moving the Altiris 6 database to the new SQL server, you will need to run NSSetup to make sure that Notification server is pointing to the right SQL server and database. To run NSSetup, open your browser on the Notification server and type the following link: http://localhost/Altiris/NS/install/nssetup.aspx or http://<server name>/Altiris/NS/install/nssetup.aspx

Then follow the steps for the NSSetup configuration:

  1. Make sure that you add/create the proper username. You can use the previous Altiris admin username or you can make a new one. Usually the format is DOMAIN\username or ComputerName\username. Then use a password that follows the criteria for your organization.
  2. Then the next screen will ask you about e-mail accounts, mail server, etc. Add that information.
  3. The last step, select the new SQL server, and select to use your previous database, and then select use application credentials (this option make sure that the username and password that you are using also it is associated to your database) or the SA account that you have on your SQL server.

Then the configuration will continue and it will take few minutes.

When the installation is done, go to Start > All Programs > Altiris > Altiris Console. It should open the Notification Server Console.

Note: This note is in case you left attached a copy of your Altiris database in the old SQL server after moving the Altiris database to the new SQL server (some customers like to have the Notification Server still pointing to the old SQL server for few more days until everything is ready on the new SQL server). In order to make the change on the Notification Server from one SQL server to another without running NSSetup, open the Notification Server console and try to point from the Configuration tab > Server settings > Notification Server Settings > Database settings and change the SQL server name so it can can point to the new SQL server and to the Altiris database copy that resides on it. You may need to follow the instructions in article 2625, "NS Report Builder does not display all available tables."

Note:  Whenever  you run a repair and/or run NSSSETUP and, you are not at the Notification Server, you must remote in as session 0.

 start>run  Mstsc.exe /v:<NSServerName> /console to connect to the NS

It is also recommended to use the Application Identity Account.


Legacy ID



20213


Article URL http://www.symantec.com/docs/HOWTO2574


Terms of use for this information are found in Legal Notices