I’ve got 15 minutes left to write a quick blog post. It’s going to be pretty short – definitely not aimed at beginners. I’ll outline the steps and provide links with further information.
Apps & Tools needed:
A few tips before we start:
- If you’re changing hosts but keep the same domain name, reduce the TTL of your domain name at your registrar before you start. This will probably speed up DNS propagation.
- Your ISP might also be a bottleneck in DNS propagation. I had to wait hours before my ISP finally updated their DNS, so I switched to Google DNS. It’s very simple and much faster.
- Backup everything – make sure there’s a way to go back if everything goes wrong!
- Clean up your WordPress install before you begin. Update all themes and plugins and remove the ones you don’t use.
Step 1: Export Your Database
Export your current database via CPanel, PHPMyAdmin or a plugin. I used WP Migrate DB and it worked like charm.
(You can change your DNS now so you don’t have to wait for DNS propagation later on.)
Step 2: Create An App + Database
Login to ServerPilot and create a new app for your website.
Create a database on your new server with the same name, user and password as the one on your current server. You can copy these details from your wp-config.php file.
Step 3: Move All Files And Folders To Your New Host
This is what usually takes up most time. Especially if you have to FTP everything to your local machine first.
If you have SSH access to your current host your lucky: you can use scp to transfer all files from one host to another.
More info on the syntax here: https://www.garron.me/en/articles/scp.html
I logged in to my current WP host and used the following command to move my entire WordPress install (3GB) to Digital Ocean in 148.9 seconds.
scp -vrC /home/user/domain/* firstname.lastname@example.org:/srv/users/serverpilot/apps/myapp/public/
Step 4: Import Your Database
I installed Adminer to import my database. It’s a single php file that you have to upload to your server – no installation requiered.
Don’t forget to download your wp-config.php file from your new server and make sure all constants are accurate. In my case I had to change the DB_HOST to localhost.
Step 5: Update Your DNS
If you haven’t done this in step 1, change your DNS to your new server.
Many thanks to all developers who made this possible.