How to move your server without as little downtime as possible

BlueNoteWeb

Verified User
Joined
Nov 4, 2004
Messages
52
Location
Denton, TX
Hey there all, I've just completed a migration from a Plesk server to a DirectAdmin server, moving several hosting clients with me. Many of these sites are database-driven storefronts, so downtime is unacceptable and there must be no loss of information. The method I used created very little downtime, though it was a lot of work for me.

For each domain:
Step 1 - create the domain on the new server. Add an empty database if it's needed. Consulting the Plesk panel on the old server, create all email addresses and forwards as they are on the old server. I asked my clients a week ago to provide all passwords to their email accounts so I could set them up the same, those who didn't were set up with a default password. I'm sure I'll get some phone calls on Monday from people who ignore my emails. Most of those people owe me money because they ignore those emails too...

Step 2 - transfer files. Log into the old server over SSH, then use SCP to move all files from one server to the other. This process takes a while, but you can do step 3 (as necessary) while you're waiting.

Step 3 - transfer database. This is where you need to take each site offline for a bit. Using whatever method is convenient, disable access to the database on the old server. Export the database using mysqldump from the command line (obviously I have multiple SSH windows open), SCP it to the new server, then import the database on the new server.

Step 4 - update configuration files. The first part can be done while the file transfer is taking place if it's not done yet. Most of my clients use the same shopping cart software (I know because I built most of their sites) so I know where to find the configuration files. I updated the database values to point to the database on the new server, then turned their sites back on. Viewing the site on the old server was a bit slower but still functional. You may get errors about not being allowed to connect from that host - copy the IP address from the screen, go into your DA panel and add that host to the allowed hosts for the database in question. On the new server I updated the configuration files to point to the new database and the new directory structure.

Step 5 - Adjust DNS settings on the old server. Each control panel is different on this, but on Plesk I created "A" records that matched the existing records, but pointed them to the new server's IP. WARNING! If any of your sites on your new server use a dedicated IP, make sure you point the DNS to THEIR IP and not the server's default IP. If you point to the server's default IP you will see a default Apache page congratulating you on installing the Apache server properly.

Step 6 - adjust SMTP routes. I don't remember the exact syntax, but do a google search and you should find it. This step redirects all incoming mail to the new server's IP address. This can be used globally or on a per-domain basis.

Step 7 - cleanup. You may have a few cleanup items to take care of, such as .htaccess files that point to the wrong directory structure, other configuration settings that point to the wrong database or directory structure, etc. You'll probably miss something, I'm sure I did. There's stuff all over the place.

Step 8 - once you've moved EVERY client off of the old server, go to your registrar and change the IP address(es) of your DNS to the new server's IP.

Step 9 - notify your clients of what steps they need to take. My clients, for example, need to log in to POP using "[email protected]" rather than just "user."

I think that's pretty much it....aside from seeing a default Apache page because I put in the wrong IP for a client on a dedicated IP (see above) my transition went smoothly. YMMV.
 
Back
Top