Migrate Master

From Virtualizor Wiki
Jump to: navigation, search

Overview

This page explains how to Migrate your master server to another server and update the slaves with the new Master information.

NOTE: This guide is for MASTER ONLY server. Not for the Master on which VPS are there.

Scenario

If you are moving the Master server to a new hardware and want to migrate your Virtualizor master, you have to follow this process.


Backup and Restore Database

For Backup
Please execute the following command to take backup of your OLD Virtualizor Master server. So that you can restore it on New Virtualizor Master server.

root# /usr/local/emps/bin/mysqldump -u root -pMYSQL_ROOT_PASS virtualizor > virtualizor_old.sql

For Restore
Copy the virtualizor_old.sql 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.

root# /usr/local/emps/bin/mysql -u root -pMYSQL_ROOT_PASS virtualizor < virtualizor_old.sql

NOTE : You can get the MYSQL_ROOT_PASS from /usr/local/virtualizor/universal.php
Or execute the following command :
root# cat /usr/local/virtualizor/universal.php | grep dbpass


Update Slaves with new Master IP

Virtualizor has a utility which will help you to update the New Master servers IP on all the Slave Servers.
Execute the following command on the new Master server to update the Master info on all slaves.

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

Update Master API Key and Pass in WHMCS

Once you have done the above steps successfully, you will have to update the Virtualizor API key and Pass on WHMCS as well. After updating test the connection and your new master is ready for the VM creation.