Get Virtualizor

Migrate Master

Notes

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.
It is recommended to pause the orders or any actions from Master panel to avoid issues.
No running task should be present while migrating Master panel.

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.
If your old and new Master servers are using Public + Private IPs and all/few slave servers are only accessible over Private IPs and were added in cluster using Private IPs, then after following the entire migrate master guide you will need to manually update Private Ip of the New Master server for 'masterip' variable in /usr/local/virtualizor/universal.php file on those slave servers which are only accessible over Private IP.

Scenario

You want to move to a new master-only server. You will need to install OS on that new server and install master-only panel and then add it to existing cluster as slave .

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

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

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.(You can use SCP for it)

scp -P destination_host_port source_file_name username@destination_host:/var/virtualizor/

Please execute the following command to restore your OLD Virtualizor Master servers database to your New Virtualizor Master server.

root> /usr/local/emps/bin/php /usr/local/virtualizor/scripts/migrate_master.php import
Migrate_master_import
Note
This action is irreversible. Please make sure you have old backup of database before proceeding. Just to be on safe side.

Once you proceed it will import the Old database and make changes in database and make your Slave server a new Master server.
You will also need to update new master ip in WHMCS/Blesta billing panel. Once the migration is successful , you will need to update license ip to correct license as desired , assuming that old license was a premium license.
If you are unable to do it from client center then we can help you via chat or ticket
If you have any custom templates then you can move them manually as well. They are stored under /var/virtualizor/ directory and for OpenVZ they are stored under /vz/template/cache/ directory.

Migrate master-only VPS

If you have Master-only panel installed in a vps on a Virtualizor slave server then you will need to follow manual migration steps.

  • Create a vps on target server, assuming its another Virtualizor slave server and then install Master-only panel in that vps.
  • You will then need to restore database backup in that vps
    https://www.virtualizor.com/docs/admin/restore-database/
    You will also need to move universal.php file stored under /usr/local/virtualizor/ directory from Old Master server to New Master server.
    Take a backup of universal.php file on new server before moving old universal.php file. You will need to copy database password($dbpass) stored in new universal.php file and paste it in old universal.php file which you copied to new server.
  • Assuming new Master-only vps will be having new ip, you will need to update the new Master vps ip in /usr/local/virtualizor/universal.php file on all of your slave servers.
  • Assuming that old license was a premium license, you will need to change license ip . If you are unable to do it from client center then we can help you via chat or ticket
  • You will also need to update new master ip in WHMCS/Blesta billing panel.
  • After updating new ips everywhere you can shutdown your old Master-only vps.

If you have any custom templates then you can move them manually as well. They are stored under /var/virtualizor/ directory and for OpenVZ they are stored under /vz/template/cache/ directory.

Update PDNS

Once you successfully Migrated your master server and if you have installed powerdns servers they will need to be updated with the new master details.
In order to do the same , you need to refer the below steps :
Step 1 : SSH your Master PDNS (NS1) and login to its mysql console :

mysql -u root -p

You can find password in PowerDNS VPS :
grep pass /etc/pdns/pdns.conf
grep pass /etc/powerdns/pdns.conf (For Ubuntu) 


Provide your PDNS Mysql password and use mysql database :

use mysql;

Step 2 : Grant access to new Master IP :

GRANT ALL ON powerdns.* TO root@'NEW_MASTER-IP' IDENTIFIED BY 'PDNS-MYSQL_PASSWORD';

FLUSH PRIVILEGES;

Step 3 : Delete user / Revoke Access.

DELETE USER root@'OLD_MASTER_IP';

FLUSH PRIVILEGES;

OR

REVOKE ALL ON powerdns.* FROM root@'OLD_MASTER_IP' IDENTIFIED BY 'PDNS-MYSQL_PASSWORD';

FLUSH PRIVILEGES;

Step 4 : 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.

If you have any queries or face any issues with it, feel free to reach our support team.
https://virtualizor.com/contact

    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list