Mysql Shift

prashantbhushan

Verified User
Joined
Jul 21, 2006
Messages
199
Location
Pune, India.
Hello,
I have one linux site with mysql on directadmin. There are huge
transactions of mysql anytime on the server.
Now i want to shift that site to the new directadmin server without
downtime. In this case how to maintain data consistency. ?

Thanks,
Prashant.
 
There is no getting away from a couple of minutes of downtime while you move the database...

  1. Create the site on the new server
  2. Transfer all files (for the website) to the new server
  3. Create the database in DirectAdmin (no content, just create the database)
  4. Add your old host to the database so you can access the database from your old host.
  5. Make sure your new site is configured (set up to use the database on the new server)
  6. Temporeraly suspend the old site
  7. Copy the database (files) to the new server
  8. Check that everything is working on the new server
  9. Reconfigure your database connection on the old server to point to the new server in stead of localhost
  10. Unsuspend your old site
  11. Update your DNS to point to the new server

I've moved plenty of sites using this method and yes, if you have access to the database files you can simply copy them from the database directory on the old server to the database directory on the new server, you don't need to make an export on the old server and import it on the new server.

Regards,
 
Excellent tutorial, Onno. Worth putting into the How-To section.

Resetting the old server to use the database on the new server is a great way to avoid leaving the old site suspended (which will cause some users grief as they still look at the old site until DNS caches clear.

One thing I'd do in advance of the move is change the TTL on the old server to a very low number of seconds. Instructions can be found here.

Jeff
 
Back
Top