This is a tutorial on how to migrate a WordPress site to a new web host. I am going to try and keep this as simple and short as possible. Just follow the steps below and you should be up and running again in no time.
How to Migrate a WordPress Site to New Host
When it comes to migrating your WordPress site, you have a few different options. The very first step is to get a backup and or export of your current site. Or if you go with a WordPress host like Kinsta, they will migrate your site for free.
Exporting Your Database
We will first need to backup your MySQL database. This is where all the content for WordPress is stored. Your post and page data, comments, plugin data, etc.
Option 1 – Cpanel
If you are running Cpanel you easily backup your database by clicking into the “Backups” area in the dashboard.
Then simply click on the name of your database and it will prompt you to save it to your computer. Pretty easy!
Option 2 – Exporting database manually with phpMyAdmin
If you don’t have Cpanel available then you can always export your database manually using phpMyAdmin. If you don’t know the URL for your phpMyAdmin page, you can always ask your web host to provide this to you. Or even ask for them to do this for you. Once you login to phpMyAdmin, click on the name of your database on the left-hand side.
Then click on the “Export” tab at the top.
Select “Custom” and make sure all the tables are highlighted. They should be by default.
Scroll down and select “Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT statement.”
Scroll down and click on “Go.” It will then prompt you to save the .mysql file to your computer.
Option 3 – Export database with WordPress Backup plugin
Your third option is to backup your database using a WordPress backup plugin. Here are a few popular ones:
We will cover this more in-depth in another post.
Exporting Your WordPress Files
Now that we have your database saved, we need to save your WordPress files. You can use the Cpanel backup method, but I recommend using FTP since we will be needing to edit a configuration file later. I suggest using FileZilla. You will need to connect to your web host. If you don’t know how, reach out to your hosting provider and they should be able to help you. You will want to grab everything from the root of your WordPress install. You should see folders like “wp-admin” and “wp-includes.” Note: If you already a fresh WordPress installation at your new host then all you need is the “wp-content” folder.
You will want to grab everything from the root of your WordPress install. You should see folders like “wp-admin” and “wp-includes.” Note: If you already a fresh WordPress installation at your new host then all you need is the “wp-content” folder.
Create Database On Your New Host and Import Tables
Now on your new host, we are going to create a new MySQL database and import your tables. This tutorial assumes you are running Cpanel.
In your Cpanel dashboard, click into “MySQL Databases.”
Name your database and click on “Create Database.” It doesn’t have to match the name it was from your previous host.
Now under MySQL Users, we need to create a new user. Make sure you keep track of what you use for the password, as you will need this in a few minutes.
Then we need to add the user to the database. Click on “Add.”
Then click “All Privileges” and click on Make Changes.
Now login to phpMyAdmin and click on your new database that you created.
Now click on “Import.”
Click on “Browse,” select your .mysql file we saved earlier, and click on “Go.”
If everything works OK you should see a green box with a message like the one below.
Change Configuration File and Upload Files via FTP
Now we need to edit your wp-config.php file to work with your new database.
In the files you downloaded earlier, look in the root folder, right click on wp-config.php and select edit.
Now you will need to update the information with what you used above. So the database name you chose, the database user, and the password. Information below is only an example. Once you update those three pieces of information, save the file.
Now upload your files to your new web host via FTP. Upload everything if you didn’t have WordPress installed at the new host. If you did, simply upload and overwrite the “wp-content” folder.
That is all! You should now be up and running on your new host. I also recommend reading our tutorial on “How to Preview Your Website Before Switching DNS.” If this tutorial on how to migrate a WordPress site was helpful, please let us know below in the comments.
Get More Stuff Like This
Marketing, WordPress, Blogging Tips, SEO and Reviews, once a week.
Thank you for subscribing.
Something went wrong.