QUESTION
How to migrate a DGE to a new machine (real or virtual)?
RESOLUTION
Note: These instructions are for migrating a Traverse DGE (upstream) to a new server of the same OS (e.g. Linux to Linux or Windows to Windows). Any references to TRAVERSE_HOME should be replaced with the actual Traverse installation directory (e.g. "C:\Program Files (x86)\Traverse" or /usr/local/traverse)
- Install the identical Traverse revision on the (new) destination server, as the original server
- Stop Traverse software components on the destination server
- Take the most recent database backup on the source DGE, review this KB: Make a current Traverse database backup
- Stop Traverse software on the (original) source server
- Copy the 'TRAVERSE_HOME\etc\licenseKey.xml' from the source to the same destination on the new server.
- Apply any customization from 'TRAVERSE_HOME\etc\emerald.xml' and 'TRAVERSE_HOME\etc\dge.xml' (namely the unique dge name) on the source to the same file on the destination server. One way to achieve this is to compare the two files to highlight the differences (e.g. 'diff' or 'compare' commands)
- In the rare case that changes have been made to any device signatures in 'etc\typedef', copy the customized device signatures from the source server to overwrite the copies in the destination server. Altering files in this folder is not recommended as the folder is overwritten during upgrades.
- Restore the MySQL databases:
Restoring DGE / MySQL Database:
Windows
Copy the following files and folders from source to the destination:
- TRAVERSE_HOME\database\mysql\aggregateddatadb\
- TRAVERSE_HOME\database\mysql\processdb\
- TRAVERSE_HOME\apps\silk\data\
- TRAVERSE_HOME\plugin\
cd TRAVERSE_HOME
net start nvdgedb
apps\mysql\bin\mysql --defaults-file=etc\mysql.conf --execute="SHOW TABLES" --database="aggregateddatadb" > tables.txt
for /F "skip=1" %G IN (tables.txt) DO @apps\mysql\bin\mysql --defaults-file=etc\mysql.conf --execute="REPAIR TABLE %G USE_FRM" aggregateddatadb >> logs\database_restore.log
apps\mysql\bin\mysql --defaults-file=etc\mysql.conf --execute="SHOW TABLES" --database="processdb" > tables.txt
for /F "skip=1" %G IN (tables.txt) DO @apps\mysql\bin\mysql --defaults-file=etc\mysql.conf --execute="REPAIR TABLE %G USE_FRM" processdb >> logs\database_restore.log
Linux
To restore the DGE database from a snapshot created by db_backup.sh, you must restore the.MYD and .FRM files from the snapshot archive in TRAVERSE_HOME/database/backup, and then rebuild the database indexes with the following steps:
- Shut down all components.
- At a command prompt, execute the following commands:
cd TRAVERSE_HOME
etc/traverse.init stop
mv database/mysql/aggregateddatadb database/mysql/aggregateddatadb.OLD
gunzip -c database/backup/backup-mm-dd-yy,hh-mm.tar.gz | tar xvf - database/mysql/backup_dge
etc/dgedb.init start restore
apps/mysql/bin/mysql --defaults-file=etc/mysql.conf --skip-column-names -u root --password= --batch -e 'show tables;' backup_dge > /tmp/names.txt
apps/mysql/bin/mysql --defaults-file=etc/mysql.conf -u root --password= --execute "CREATE DATABASE aggregateddatadb;"
for i in `cat /tmp/names.txt`; do apps/mysql/bin/mysql --defaults-file=etc/mysql.conf -u root --password= --execute "RESTORE TABLE $i FROM 'TRAVERSE_HOME/database/mysql/backup_dge'" aggregateddatadb; done
etc/dgedb.init stop
rm -rf database/mysql/backup_dge
etc/traverse.init start - On the source server:
cd /tmp/
tar zxvf TRAVERSE_HOME/database/backup/backup-mm-dd-yy,hh-mm.tar.gz database/backup/backup_dge
tar zxvf TRAVERSE_HOME/database/backup/backup-mm-dd-yy,hh-mm.tar.gz database/backup/backup_apm- Copy the following files and folders from source to the destination:
SOURCE (old DGE): /tmp/database/backup/backup_dge
DESTINATION (new DGE): TRAVERSE_HOME/database/mysql/backup_dge/
SOURCE (old DGE): /tmp/database/backup/backup_apm
DESTINATION (new DGE): TRAVERSE_HOME/database/mysql/backup_apm/ - Copy the following files and folders from source to the destination:
TRAVERSE_HOME\apps\silk\data\
TRAVERSE_HOME\plugin\
- Copy the following files and folders from source to the destination:
- On the destination server:
cd TRAVERSE_HOME
etc/dgedb.init start restore
apps/mysql/bin/mysql --defaults-file=etc/mysql.conf --skip-column-names -u root --password= -e 'show tables;' --database=backup_dge > /tmp/tables.txt
apps/mysql/bin/mysql --defaults-file=etc/mysql.conf -u root --password= < database/schema/mysql/dropDGEdb.sql
apps/mysql/bin/mysql --defaults-file=etc/mysql.conf -u root --password= < database/schema/mysql/createDGEdb.sql
apps/mysql/bin/mysql --defaults-file=etc/mysql.conf -u root --password= < database/schema/mysql/createDGEdbUsers.sql
for i in `cat /tmp/tables.txt`; do apps/mysql/bin/mysql --defaults-file=etc/mysql.conf -u root --password= --execute "RESTORE TABLE $i FROM 'TRAVERSE_HOME/database/mysql/backup_dge'" aggregateddatadb; done
apps/mysql/bin/mysql --defaults-file=etc/mysql.conf -u root --password= < database/schema/mysql/createDGEdbProcs.sql
apps/mysql/bin/mysql --defaults-file=etc/mysql.conf --skip-column-names -u root --password= -e 'show tables;' --database=backup_apm > /tmp/tables.txt
apps/mysql/bin/mysql --defaults-file=etc/mysql.conf -u root --password= < database/schema/mysql/dropAPMdb.sql
apps/mysql/bin/mysql --defaults-file=etc/mysql.conf -u root --password= < database/schema/mysql/createAPMdb.sql
apps/mysql/bin/mysql --defaults-file=etc/mysql.conf -u root --password= < database/schema/mysql/createAPMdbUsers.sql
for i in `cat /tmp/tables.txt`; do apps/mysql/bin/mysql --defaults-file=etc/mysql.conf -u root --password= --execute "RESTORE TABLE $i FROM 'TRAVERSE_HOME/database/mysql/backup_apm'" processdb; done
apps/mysql/bin/mysql --defaults-file=etc/mysql.conf -u root --password= < database/schema/mysql/createAPMdbProcs.sql - Depending on the destination OS, please follow these steps:
- Linux
cd TRAVERSE_HOME
etc/dgedb.init stop
utils/db_optimize.pl -r - Windows
cd TRAVERSE_HOME
net stop nvdgedb
utils\db_optimize.pl -r
- Linux
- Start the Traverse components on the (new) destination server
- Linux
You may now delete the database/mysql/backup_dge and database/mysql/backup_apm directories after verifying test history within the Traverse UI
APPLIES TO
All versions of Traverse, though 'processdb' may not exist in early versions