Hello,
it may have been already discussed, but my issue is little specific, as i have cPanel on a VPS which i can backup and then restore.
In the near future i will need to move OpenVZ virtual private server with cpanel installed on it from one physical server to another within one datacenter.
I think i may use vzdump or openvz.org/Man/vzmigrate.8 vzmigrate tool which is using rsync to do VPS migration with minimum downtime.
The server IP will remain the same, my provider agreed that he can switch IP subnet between source and destination server at defined time.
Do you please have any advice regarding the migration from server to server so all important data are in sync before i allow access/writing into new/restored server files?
This is my rough plan and i hope you can help adjust it.
I can for example execute bash script to:
- create dump of whole cpanel VPS
- transfer + restore it on destination server
- service chkservd stop;service httpd stop;service mysqld stop;service pure-ftpd stop;service exim stop
- then i would need to execute rsync command to sync certain directories like mysql (which ones i should rsync) with destination server (which will have different IP because current IP is still routed to old machine)
- then i would need to either forward all visitors of old VPS to new VPS IP:
a)
b) revsys.com/writings/quicktips/ssh-tunnel.html HOWTO: SSH Tunneling Made Easy
c) debuntu.org/how-to-redirecting-network-traffic-to-a-new-ip-using-iptables/ How-To: Redirecting network traffic to a new IP using IPtables
(will the sites work on new VPS IP even i temporarily has old VPS IPs in DNS zones etc.? Or what is the better solution to reduce time for which people can not access their websites?
- once IPs are routed to new machine, i assign correct IP to the new VPS and all starts working
Please do you have idea on commands or schedule that is more simple and allows shorter downtime?
Source and destination OS is CentOS 6.
it may have been already discussed, but my issue is little specific, as i have cPanel on a VPS which i can backup and then restore.
In the near future i will need to move OpenVZ virtual private server with cpanel installed on it from one physical server to another within one datacenter.
I think i may use vzdump or openvz.org/Man/vzmigrate.8 vzmigrate tool which is using rsync to do VPS migration with minimum downtime.
The server IP will remain the same, my provider agreed that he can switch IP subnet between source and destination server at defined time.
Do you please have any advice regarding the migration from server to server so all important data are in sync before i allow access/writing into new/restored server files?
This is my rough plan and i hope you can help adjust it.
I can for example execute bash script to:
- create dump of whole cpanel VPS
- transfer + restore it on destination server
- service chkservd stop;service httpd stop;service mysqld stop;service pure-ftpd stop;service exim stop
- then i would need to execute rsync command to sync certain directories like mysql (which ones i should rsync) with destination server (which will have different IP because current IP is still routed to old machine)
- then i would need to either forward all visitors of old VPS to new VPS IP:
a)
Code:
iptables -t nat -I PREROUTING -p tcp -d OLD_IP_HERE --dport 80 -j DNAT --to NEW_IP_HERE
c) debuntu.org/how-to-redirecting-network-traffic-to-a-new-ip-using-iptables/ How-To: Redirecting network traffic to a new IP using IPtables
(will the sites work on new VPS IP even i temporarily has old VPS IPs in DNS zones etc.? Or what is the better solution to reduce time for which people can not access their websites?
- once IPs are routed to new machine, i assign correct IP to the new VPS and all starts working
Please do you have idea on commands or schedule that is more simple and allows shorter downtime?
Source and destination OS is CentOS 6.
Last edited by a moderator: