The following are the steps to backup and restore database in NCM.
Steps to backup and restore database in NCM Combination setup
1 Login to NCM server from which you want to take the backup of database, and then set the VOYENCE_HOME environment variable.
For example, in Linux, execute the following command: source /etc/voyence.conf
2 Take the backup of database by using the backup.pl script under the <VOYENCE_HOME>/ tools directory.
The script creates a “backup-image-.*.tgz” file under the VOYENCE_HOME>/data-image directory.
Note If you have Smarts Adapter configured with SMARTS IP and SAM, the backup.pl script will also backup the Smarts Adapter data.
3 Copy the “backup-image-.*.tgz” file to a host where a new NCM Combination setup is installed. The backup file can be copied under any directory.
4 Login to the new NCM server setup, and then execute the following command: VMware Smart Assurance Network Configuration Manager Installation Guide
source /etc/voyence.conf
5 Execute the following command from the <VOYENCE_HOME>/tools directory if you are restoring database across the same NCM version:
perl restore.pl <Absolute path to backup image file /backup-image-.*.tgz>
6 Execute the following command from the <VOYENCE_HOME>/tools directory if you are restoring database on higher NCM version:
perl restore.pl <Absolute path to backup image file /backup-image-.*.tgz> --force
7 Update the InfraDB entry with the Device server host name. To update the InfraDB entry, perform the following steps:
8 From the <VOYENCE_HOME>, execute the following command: \cgi-bin\cflist.cgi > cflist.txt
9 Edit the cflist.txt to change the Device server FQDN to the new Device server FQDN (Same as Combination server FQDN).
For example, POP 1000 “<hostname>”
10 Execute the following command. It must return 'Status: 200 Success'. \cgi-bin\cfwrite.cgi < cflist.txt
11 To update the Device server FQDN in cm_device_server table in the database, do the following:
12 Login to NCM UI, and then navigate to Tools > System Administration > Global > Access >
Device Servers.
13 Select the Device server, and then click Edit. 14 In the Edit Device Server window, click OK.
Or,
Run the following command from [Product directory]\db\controldb\bin:
psql.exe -h -d voyencedb -U pgdba -p 5435 -c "update cm_device_server set device_server_name='Device_Server_name';"
15 If you have Smarts Adapter configured in your previous NCM setup, follow these steps: On Linux
16 Stop the NCM Smarts Adapter service. service ncmsmartsadapter stop
17 Change the directory to $VOYENCE_HOME/NCMSmartsAdapter/.
18 Open and edit the prodDb.script file, so that VOYENCE_CONFIGURATION table and SMARTS_CONFIGURATION table is populated with actual AS host name, as follows: 19 Search for
INSERT INTO VOYENCE_CONFIGURATION VALUES
(1,4,TRUE,'auth.conf','2','10000','linbgh125.lss.vmware.com','jUpFF0M5HQuOdJUqIYKo0w==',' sysadmin')
20 Replace the old Application server host name with new Application server host name. For example, replace 'linbgh125.lss.vmware.com' with '<new Application server host name>'. 21 Search for
INSERT INTO SMARTS_CONFIGURATION VALUES
(1,5,'aced0005757200135b4c6a6176612e6c616e672e537472696e673badd256e7e91d7b4702 000078700000000274000e494e4348415247452d414d2d504d74000353414d','10.31.202.13 1',426,NULL,'z/RS9si+EWVsdA8kxzEovg==','SAM','linbgh131.lss.vmware.com','10.31.202.131','z/ RS9si+EWVsdA8kxzEovg==','46499','admin',TRUE,'admin','linbgh125.lss.vmware.com') 22 Replace the old Application server host name with new Application server host name.
For example, replace 'linbgh125.lss.vmware.com' with '<new Application server host name>'. 23 Open and edit the prodDb.script file, so that TOPOLOGY_SYNC table is populated with actual
DS host name, as follows: 24 Search for
INSERT INTO TOPOLOGY_SYNC VALUES (1,43,120,300,TRUE,TRUE,200,'INCHARGE-AM- PM','DisplayName','Active Sync
On',NULL,TRUE,FALSE,TRUE,TRUE,TRUE,TRUE,FALSE,'linbgh127.lss.vmware.com','1000','Deri ved','IP Devices','Run Upon Approval')
25 Replace the old device server host name with the new device server host name.
For example, replace 'linbgh127.lss.vmware.com' with '<new Device server host name>'. 26 Stop the NCM Smarts Adapter service.
sc stop VcSmarts (DOS command)
27 Change the directory to %VOYENCE_HOME%/NCMSmartsAdapter/.
28 Open and edit the prodDb.script file, so that VOYENCE_CONFIGURATION table and SMARTS_CONFIGURATION table is populated with actual AS host name, as follows: 29 Search for
INSERT INTO VOYENCE_CONFIGURATION VALUES
(1,4,TRUE,'auth.conf','2','10000','linbgh125.lss.vmware.com','jUpFF0M5HQuOdJUqIYKo0w==',' sysadmin')
30 Replace the old Application server host name with new Application server host name. For example, replace 'linbgh125.lss.vmware.com' with '<new Application server host name>'. 31 Search for
INSERT INTO SMARTS_CONFIGURATION VALUES
(1,5,'aced0005757200135b4c6a6176612e6c616e672e537472696e673badd256e7e91d7b4702 000078700000000274000e494e4348415247452d414d2d504d74000353414d','10.31.202.13 1',426,NULL,'z/RS9si+EWVsdA8kxzEovg==','SAM','linbgh131.lss.vmware.com','10.31.202.131','z/ RS9si+EWVsdA8kxzEovg==','46499','admin',TRUE,'admin','linbgh125.lss.vmware.com') 32 Replace the old Application server host name with new Application server host name.
For example, replace 'linbgh125.lss.vmware.com' with '<new Application server host name>'. 33 Open and edit the prodDb.script file, so that TOPOLOGY_SYNC table is populated with actual
DS host name, as follows: 34 Search for
INSERT INTO TOPOLOGY_SYNC VALUES (1,43,120,300,TRUE,TRUE,200,'INCHARGE-AM- PM','DisplayName','Active Sync
On',NULL,TRUE,FALSE,TRUE,TRUE,TRUE,TRUE,FALSE,'linbgh127.lss.vmware.com','1000','Deri ved','IP Devices','Run Upon Approval')
35 Replace the old device server host name with the new device server host name.
For example, replace 'linbgh127.lss.vmware.com' with '<new Device server host name>'.
Steps to backup and restore database in NCM distributed setup
1 Login to NCM Application server from which you want to backup database, and then set the VOYENCE_HOME environment variable.
For example, in Linux, execute the following command: source /etc/voyence.conf
2 Stop the tomcat service running on the remote RA server.
3 Take the backup of database by using the backup.pl script under the <VOYENCE_HOME>/ tools directory.
The script creates a “backup-image-.*.tgz” file under the VOYENCE_HOME>/data-image directory.
Note If you have Smarts Adapter configured with SMARTS IP and SAM, the backup.pl script will also backup the Smarts Adapter data.
4 Copy the “backup-image-.*.tgz” file to a host where a new NCM Application server is installed. The backup file can be copied under any directory.
5 Login to the new NCM Application server setup, and then execute the following command: source /etc/voyence.conf
6 Execute the following command from the <VOYENCE_HOME>/tools directory if you are restoring database across same NCM version:
7 Execute the following command from the <VOYENCE_HOME>/tools directory if you are restoring database on higher NCM version:
perl restore.pl <Absolute path to backup image file /backup-image-.*.tgz> --force
8 Update the InfraDB entry with Device server host names and IP addresses. To update the InfraDB entry, perform the following steps:
9 From the <VOYENCE_HOME>, execute the following command: \cgi-bin\cflist.cgi > cflist.txt
10 Edit the cflist.txt to change all Device server FQDN and IP address to the new Device server FQDN and IP address.
For example, POP 1000 "<HOSTNAME>" NetList= RsrcList= DevList=1001,1002 EmsList= : ADDR="<IPADDRESS"
11 Execute the following command. It must return 'Status: 200 Success'. \cgi-bin\cfwrite.cgi < cflist.txt
12 On the new Application server, go to the <VOYENCE_HOME>/bin directory, and then add all distributed Device servers to the lockbox using cstdriver utility:
13 cstdriver -lockbox <VOYENCE_HOME>/data/lockb.clb -passphrase <passphrase> -addHost <FQDN of Device server>
14 cstdriver -lockbox <VOYENCE_HOME>/data/lockb.clb -passphrase <passphrase> -addHost <FQDN>
15 Restart the vcmaster service in the Application server host.
16 Copy and replace the <VOYENCE_HOME>/data/lockb.clb file from Application server host to all Device server host under <VOYENCE_HOME>/data/lockb.clb.
17 Change the ownership of the lockb.clb file to root:cst using the command:
chown root:cst lockb.clb
18 Change the file permissions of the lockb.clb file to 640 using the command:
chmod 640 lockb.clb
19 Copy and replace the following from the old Device server to new Device server:
n <VOYENCE_HOME>/data/devserver/configuration/ad_nextIdx
n <VOYENCE_HOME>/data/devserver/configuration/ad_numIdxIHavefiles
20 Change the ownership of both the files to root:voyence using the commands:
chown root:voyence ad_nextIdx
chown root:voyence ad_numIdxIHavefiles
21 Change the file permissions of both the files to 660 using the commands:
chmod 660 ad_nextIdx
chmod 660 ad_numIdxIHavefiles
22 Restart the vcmaster service in all distributed Device server hosts.
23 Change the ownership of the lockb.clb file to root:cst using the command:
chown root:cst lockb.clb
24 Change the file permissions of the lockb.clb file to 640 using the command:
chmod 640 lockb.clb
25 To update all Device server FQDN in cm_device_server table in the database, do the following:
26 Login to NCM UI, and then navigate to Tools > System Administration > Global > Access >
Device Servers.
27 Select each Device server, and then click Edit. 28 In the Edit Device Server window, click OK.
Or,
Run the following command from [Product directory]\db\controldb\bin:
psql.exe -h -d voyencedb -U pgdba -p 5435 -c "update cm_device_server set device_server_name='Device_Server_name';"
29 If you have Smarts Adapter configured in your previous NCM setup, follow these steps: On Linux
30 Stop the NCM Smarts Adapter service. service ncmsmartsadapter stop
31 Change the directory to $VOYENCE_HOME/NCMSmartsAdapter/.
32 Open and edit the prodDb.script file, so that VOYENCE_CONFIGURATION table is populated with actual AS host name, as follows:
33 Search for
INSERT INTO VOYENCE_CONFIGURATION VALUES
(1,4,TRUE,'auth.conf','2','10000','linbgh125.lss.vmware.com','jUpFF0M5HQuOdJUqIYKo0w==',' sysadmin')
34 Replace the old Application server host name with new Application server host name. For example, replace 'linbgh125.lss.vmware.com' with '<new Application server host name>'. 35 Start the NCM Smarts Adapter service.
service ncmsmartsadapter start 36 Stop the NCM Smarts Adapter service.
sc stop VcSmarts (DOS command)
37 Change the directory to %VOYENCE_HOME%/NCMSmartsAdapter/.
38 Open and edit the prodDb.script file, so that VOYENCE_CONFIGURATION table is populated with actual AS host name, as follows:
39 Search for
INSERT INTO VOYENCE_CONFIGURATION VALUES
(1,4,TRUE,'auth.conf','2','10000','linbgh125.lss.vmware.com','jUpFF0M5HQuOdJUqIYKo0w==',' sysadmin')
40 Replace the old Application server host name with new Application server host name. For example, replace 'linbgh125.lss.vmware.com' with '<new Application server host name>'. 41 Start the NCM Smarts Adapter service.
sc start VcSmarts (DOS command)