A successful migration is all about preparation. Everything needs to be done step-by-step to make sure that it gets done right. It’s actually not that difficult to move WordPress from one host to another. It’s just a matter of following some steps and you’ll get it done. In this post I’m going to walk you through the steps you need to take to carry out a manual WordPress migration across web hosts. Here’s what you’ll need to get started:
Access to phpMyAdmin on your old and new host
Your FTP login credentials
The Steps
If you just want a quick checklist, here’s what you need to do:
Back up your MySQL database
Download your website’s files using FTP
Create an add-on domain at your new host
Create a new MySQL database
Create a MySQL database user
Upload your MySQL backup
Edit wp-config.php
Upload your files using FTP
Update your Domain Nameservers
Let’s go through it in detail.
1. Back up Your MySQL Database
Log in to your hosting account and locate phpMyAdmin. The icon will look something like this:
You may be asked to log into phpMyAdmin, in which case you will need your phpMyAdmin login details.
On the left hand side you will see a list of databases. Select the database you wish to migrate.
Tip: the below screenshots are taken from the latest version of phpMyAdmin. If your phpMyAdmin looks different and you’re finding them confusing, check out this guide on the WordPress Codex to Backing up WordPress. Then click on the export tab.
If asked, choose the custom export method.
Select all tables that you use for WordPress (if you have other programs installed in your database you may have other tables). WordPress tables will have the prefix wp_, unless you opted for another prefix upon install.
Under Format make sure you have SQL selected.
Under options make sure that the following are selected:
Add Drop table
Add Create Procedure
Create Table Options: auto_increment
enclose table and field names with backquotes
When you’re happy, click on Go.
2. Download your Website’s Files using FTP
Open an FTP program such as FileZilla and connect to your server. You will need the following credentials to log in:
FTP username
FTP password
FTP hostname
If you don’t have these details, contact your web host.
Navigate to your website’s location and drag and drop the files from your remote server to your computer.
3. Create an Addon Domain at Your New Host
You’ll need to create an addon domain at your new host where you can install WordPress. This basically means that you are adding your domain to your hosting account. Some hosting accounts do have restrictions on the number of add-on domains your hosting account can have.
In your CPanel, or whichever tool you manage your hosting with, find the Addon Domain icon. Add the domain that you are using for your WordPress installation.
Tip: If you are moving domains, things get more complicated as you need to replace references to the old domain in your database. I’ll cover that in a later tutorial. But if you are planning to search and replace on your database, you can safely do it using IT/Interconnect’s Search and Replace tool.
4. Create a New MySQL Database
Log in to your new hosting provider and create a new MySQL database. Click on the MySQL databases icon.
Give your database a name and click create.
5. Create a MySQL Database User
Your database needs a username and password which will be added to wp-config.php.
Tip: For security, we recommend that you create a new MySQL user and password for each database you use and for each piece of software included in that database. This ensures that, should one of your installations be compromised, the others are protected.
Create the database user.
Add the user to your new MySQL database.
Be sure to make note your your database name, username and password.
6. Upload your MySQL Backup
Now that your database is created you can log in to it and upload the backup of your original website. Open up phpMyAdmin in your new hosting account and locate your newly created database. Click on it.
At the top of the screen you’ll see the import tab. Click on it:
Click on the choose button and find the backup you downloaded from your old hosting provider.
Click Go.
7. Edit wp-config.php
Locate your website’s files on your computer and open up wp-config.php
Locate these lines:
Your own database credentials will be in there. Replace the credentials of the old database with the credentials for your new database that you’ve just created. These will be:
The name of your database
Your database username
Your database password
Save wp-config.php
8. Upload your Website Files Using FTP
Open up your FTP program again. This time navigate to your new remote server. You’ll get your details from your hosting provider.
Drag and drop your files from your computer to your live server:
9. Update your Domain Nameservers
Finally, it’s time to update your nameservers at your domain registrar. This could be at your old hosting provider or at another domain registrar.
Log in to your domain registrar and locate your DNS settings.
Add the nameservers for your new hosting account. These will have been provided to you when you signed up.
Save and you’re done! Once your DNS are updated your site migration is complete!
Troubleshooting
My pages are showing 404 errors: how can I fix it?
Log in to your WordPress admin screens and navigate to Settings > Permalinks.
Select a different format for your permalinks, save, and then revert back to your preferred permalinks. This will flush your rewrite rules and should correct the problem.
Why is some of my functionality not working?
Check to make sure all of your plugins are activated. They may have become deactivated in the migration process.