cPanel & WHM Version 94 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Fully automatic two step migration to a new server using rsync

Monarobase shared this idea 8 years ago
Open Discussion

Hello,


Here is our problem :


Even on servers with a full 1 Gbps connection, and using cPanel's migrate utility that syncs the files directly without compression during the migration, migrating an account with 100GB of data can take a long time and this is not acceptable for sites with active communities or companies with large e-mail accounts.


Here is the solution :


1) Reduce DNS TTL to 5 minutes at least 4 hours before migrating (depending on default DNS entries TTL)

2) Rsync homedir data accross before migrating

3) Migrate account using an aditional rync before starting and another rync to perform the final migration of the account's homedir.

4) Change DNS zones on old server as well as on the new server so they both point to the new server.

5) E-mail user with a customizable e-mail explaining that his account has been migrated to a new server and what he needs to do to update his e-mail client settings, FTP and cPanel access URLs…


Note : Any DNS entries that do not point to the old servers IP or the users IP should be left unchanged on both servers. Sometimes this is not the case with current account migrations.


We currently do this manually, it works well and we can do a full migration of a 200GB account with only 5 minutes downtime.


We would like cPanel to allow us to do this automaticaly and on multiple accounts. If the procedure worked well we could easily migrate all accounts on a server to a new server with close to zero downtime. Customers would be happy and migrating a whole server would be alot less of a worry.

Comments (2)

photo
1

I believe this is solved by the "Email routing" part of the "Express Transfer"...


http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/CopyMultiple#Express transfers

photo
2

No, not all of it.


It is technicaly possible to migrate a very large account (200 GB for example) with only a few minutes downtime usiing this method.


The DNS TTL need's to be reduced to the minimum RFC allows

All files need to be rsyncd to the new server (multiple times) to ensure that the transfer will be quick.


The express transfer section makes sure your e-mails are not lost but doesn't prevent downtime as the website is put off line before sendng the files.


I've put together a script that does all of this except the DNS and is too messy to post here and needs to be manually configured for each account. I migrated a 200GB account with less than 5 minutes downtime with it.


The whole procedure could be easily done by cPanel and could allow hosts make sure sites are only down for the minimum required time.

photo
1

Would you share your script or your rsync command? I'm migrating lot of accounts with tons of Gb


Thanks in advance

photo
Leave a Comment
 
Attach a file