How I migrate servers in 20 minutes

This somewhat requires you’ve followed my suggestions on not committing yourself to a certain host or your own DNS or mail servers, if not the extra steps might take you 10 more minutes, maybe days.

There are plenty of ways to migrate to a new server depending on how you’ve setup the server or your host, these are just to show the simplicity of my migrations after following the post linked above.

Step 1:

Rsync your other server’s files to the new one.

SSH into your new box and run rsync to connect to the old machine through ssh. It’s going to pull over every file to the new host that you specify.

rsync -avz -e ssh root@[OLD MACHINE IP]:/home /

example

rsync -avz -e ssh root@64.13.227.XX:/home /

This is probably the most important time saver, it will help dramatically in a planned migration since you can run this multiple times after the initial sync. The purpose of rsync is that it will only pull over changed files since the initial rsync.

Step 2.

Run a mysqldump your DB and either use scp to grab the file from your old host or use wget after placing the dump in an accessible place on your webserver. Then just import it after receiving it on the new host.

Step 3.

For people running their own server you’ll now just need to reconfigure apache, which shouldn’t take long since there will only be slight changes in the new httpd.conf file.

About the Author, Dan Cameron:

I'm the owner and solution engineer at Sprout Venture, a web solutions company that specializes in web development including WordPress.

I started my first blog in 2003 and transitioned to WordPress in 2004. Since moving to WordPress I've written a few plugins and themes for public consumption. Lately I'm busy engineering/building/coding and have only been able to share a few code snippets.

If you're in need of some web development, web design or custom WordPress plugins and/or themes contact me, I'll be happy to discuss it with you.

Read More »

  • Wow thanks. I need to get more comfortable running these commands. Especially with moving files to a new server, as that is a common task.
blog comments powered by Disqus