Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
We are planning to move our site to a new machine, with as little as down time as possible. The site is a small forum, so it can always changing every minutes.
As a note both machine are remote machine. We only have ssh tunnel and http connection.
So here is what we have for a plan:
Copy all data (and database) from old machine to the new machine using rsync
Make an announcement that at scheduled time, there will be a down time.
make dummy.mysite.com as a mirror copy (at certain point) of www.mysite.com
At scheduled time, make both www.mysite.com and dummy.mysite.com offline, and point DNS www.mysite.com to new machine, pointing the same directory as dummy.mysite.com, and remove name for dummy.mysite.com
re-rsync databases on both machine
After rsync completed, turn www.mysite.com on new machine online
My question is:
Will this plan works?
Can rsync copy changed part of a file instead of copying whole file? Assuming mysql MYD file changed because of mysql transaction, can rsync copy only part of file that changed instead of copying whole file again? Copying over 100+ MB mysql file only because of mysql add a single record won't be a smart move...
Does anyone have a better and easier plan to do this?
This is my first experience moving host on a live site.
Any help appreciated.
I wouldn't use rsync on the databases. I would do a backup and restore or set up mysql replication. rsync'ing databases can cause problems with the integrity of the database.
The biggest chunk is 550MB, and will take transfer time 30-60 minutes.
Other databases are smaller. To move everything will takes approximately two hours...
I didn't do compression, but I'm using on the fly compression during rsync/scp.
Just thinking that direct rsync will be easier, faster, and fail-proof
We just want our down time as short as it can, just for user's comfort
Distribution: slack current with 2.6.16.18 (still off the hook)
Posts: 284
Rep:
Well if you use InnoDB and you can enable binary logs, upload the dump of the day before and sync up the logs of the day, then import from the logs up to the date.
Another way to go is to compress on the fly the same day:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.