Migrate Master New

From Virtualizor Wiki
(Redirected from Migrate Master)
Jump to: navigation, search

Overview

This guide will help you in case you want to make any of your slave server a Master and OLD master a slave server or discard it.

NOTE: This guide will require Master server to be empty. i.e. No VMs should be there on teh Master server. NOTE: This action is irreversible. Please make a backup of the original Database before proceeding. So in case of failure or you want to revert the changes after export, you can restore the original database.

Scenario

If you want to make any of your slave server a Master server and current master as a slave server.

Export

Please execute the following command to export the database. So that you can restore it on other slave server / new server.

root# /usr/local/emps/bin/php /usr/local/virtualizor/scripts/migrate_master.php export

Above command will ask you the slave server which you want to make a new master server.

Migrate master export.png

Once you provide the slave server ID, it will make changes in the DB and export the database at the following location : /var/virtualizor/virtualizor_migrate_master.sql.gz

Migrate master export1.png

Once this step is done. Your OLD Master will not be able to make any calls to your slave servers.

Import

Copy the virtualizor_migrate_master.sql.gz from old server to new server. Please execute the following command to restore your OLD Virtualizor Master servers database to your New Virtualizor Master server. NOTE: This action is irreversible. Please make sure you have old backup of database before proceeding. Just to be on safe side.

Migrate master import.png
root# /usr/local/emps/bin/php /usr/local/virtualizor/scripts/migrate_master.php import

Once you proceed it will import the Old data base and make changes in database and make your Slave server a new Master server.

Update PDNS

NOTE: This script is available since 2.9.8.1.

Once you change your master server and if you have installed powerdns server they will need to be updated with the new master details. Please execute the following script on PDNS Master server to update your NEW server IP.

COMING SOON

Once it is finished your pdns server will be updated with the new master server, so that you can manage your pdns records from new master server.