This article explains how to perform data migration between two DNSManager servers avoiding the XML export - import option from the web interface. The indications included here are recommended in case you want to move your installation onto a new server, or if your server suffered a failure and you want to import your data on a new server.
Step-by-step guide
To migrate DNS Manager between two servers, follow the steps below and keep in mind that this operation can only be done manually.
There are two ways you can perform a migration:
- from the web interface, using the XML export option on the source server and then the XML import for the destination server
- using the latest database dump created by the dbdump script
Back up the Database
- On the old server, run the /usr/local/dnsmanager/bin/dbdump script. This will perform a full database backup.
- Once it's complete, the file /var/lib/dnsmanager/dumps/dnsmanagerwmysql.daily.dump.0.gz should be copied to the new server in the /root directory.
Note |
---|
The dbdump script uses the /etc/dnsmanager/dnsmanager.conf file to read the location of the backups. By default DUMPS_D from local.conf is set to /var/lib/dnsmanager/dumps. |
Get database login from old server
The database login username is taken from the /etc/dnsmanager/dnsmanager.conf using the following command:
Shell |
---|
cat /etc/dnsmanager/dnsmanager.conf | grep DB_USER | awk '{print $2}' |
Set up the new server
If you haven't already installed the latest version of DNSManager, do it now using the
...
Once installed, take the following steps:
Obtain the value below. This value will be called NEW_DB_USER.
Shell cat /etc/dnsmanager/dnsmanager.conf | grep DB_USER | awk '{print $2}'
Unzip database backup from /root.
Shell gzip -d dnsmanagermysql.daily.dump.0.gz
Change user in the dump.
Shell sed -i 's/OLD_DB_USER/NEW_DB_USER/g' dnsmanagermysql.daily.dump.0
Note Replace OLD_DB_USER with DB_USER value from the old server and NEW_DB_USER with DB_USER value from the new server.
Log in to MySQL using the following command:
Shell mysql -u`cat /etc/dnsmanager/dnsmanager.conf |grep DB_USER | awk '{print $2}'` -p`cat /etc/dnsmanager/dnsmanager.conf | grep DB_PASSWD | awk '{print $2}'`
Then execute this:
Code Block DROP DATABASE dnsmanager; CREATE DATABASE dnsmanager; quit
Load the old database.
Shell mysql --force -u`cat /etc/dnsmanager/dnsmanager.conf |grep DB_USER | awk '{print $2}'` -p`cat /etc/dnsmanager/dnsmanager.conf | grep DB_PASSWD | awk '{print $2}'` --default-character-set=utf8 dnsmanager < dnsmanagermysql.daily.dump.0
In case you migrate form an old version, you need to run mysql_upgrade utility.
Shell mysql_upgrade -u`cat /etc/dnsmanager/dnsmanager.conf |grep DB_USER | awk '{print $2}'` -p`cat /etc/dnsmanager/dnsmanager.conf | grep DB_PASSWD | awk '{print $2}'` --force
Force install dnsmanager-core.
Shell yum -c /etc/dnsmanager-yum.conf reinstall dnsmanager-core
Restore zone files from the database:
Shell /usr/local/dnsmanager/admin/sbin/zonemng -r
Restart dnsmanager, named, zonemngd and updateurld and that should be it.
Related articles
Content by Label | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.