To move the MySQL server from one physical box to another, you need to do the following:
- Prepare a new box with MySQL using H-Sphere installer.
- Using E.Manager, create a new physical server and add the MySQL group
(or add this group to the physical server you are planing to move MySQL server to).
- Stop the Control Panel.
- In the H-Sphere database, run the following commands:
update l_server set p_server_id=[new_p_server_id] where id=[id_of_MySQL_logical_server];
(1 record)
update l_server_ips set ip='[new_MySQL_server_IP]', mask='[new_MySQL_server_mask]'
where l_server_id=[id_of_MySQL_logical_server] and flag=4;
(1 record)
- Start the Control Panel.
- Stop MySQL.
- Run 'su - mysql' to land into mysql user directory, then
run 'pwd' to get mysql home dir location; move this directory to the new server
(including mysql database and .my.cnf file.).
- Start MySQL on the new server.
- Change the IP in A DNS record for MySQL server in service DNS zone (using Control Panel).
- Change the IP of MySQL server in phpMyAdmin configuration ($cfgServers[$i]['host'] in
in the config.inc.php file in PhpMyAdmin directory; $i is the number of the MySQL server
in PhpMyAdmin configuration: $i=1,2,...).
- Change the IP of database server in all user scripts which access the MySQL databases via IP address.
- After the IP change, MySQL hostname will still resolve to the old IP address during the
propagation period. To avoid this problem,
install and
configure
TCP proxy on the old server.
|