Ideally, you’ll pick a hosting provider that’s so good you won’t ever need to move your website. However, not all hosting providers offer the same level or quality of service. If you choose the wrong one, you may have to move your WordPress site at some point.
Fortunately, migrating your site isn’t as complex as you might imagine. It can take a few hours, but the process is relatively straightforward, Plus, if you choose a web host that offers better performance and more features, the effort will be well worth it.
In this article, we’ll teach you the best way to migrate a WordPress website, step by step. Then we’ll introduce you to some WordPress migration tools you can use to simplify the process. Let’s get moving!
How Can I Move My WordPress Site to a New Host?
For a website to be available online, it needs a server. However, just because you set up your site on one web hosting provider’s server doesn’t mean it’s stuck there permanently. In fact, nothing is stopping you from moving your entire website to a new web host.
Of course, this process is more complex than just copying over a few files. You’ll need to:
- Back up your WordPress site’s files.
- Make a copy of your current database.
- Import your database and site files to your new web host.
- Modify your new wp-config.php file.
Don’t worry if some of those steps don’t make sense at this point – we’ll walk you through the entire process in a moment. First, let’s talk about how you can migrate your WordPress site.
Should I Migrate My WordPress Site Manually or Automatically?
Migrating a WordPress website isn’t hard. However, if you want to do so manually, you’ll need to be comfortable using File Transfer Protocol (FTP), accessing databases, and modifying files on your site’s back end.
Those processes sound complex, but they’re simple enough if you follow a clear tutorial (which is where we come in!). However, if you’d rather try a simpler approach, you can always use a WordPress migration tool or plugin. There are several options, and we’ll introduce you to some of our top picks later on.
Keep in mind that large websites can be more prone to errors when using migration plugins. In those cases, manual migration is the better approach. If you follow the instructions carefully, you shouldn’t run into any problems.
Finally, it’s worth noting that some web hosts offer free migration services to new subscribers. You can also hire a third-party service to help you move your site, although that can be a pricey solution (and you’d need to make sure you choose a company with a sterling reputation).
How to Migrate Your WordPress Site Manually
Even if you’re not afraid to roll up your sleeves and migrate your site by hand, you’ll probably want a little help getting started. Let’s walk through the process, one step at a time.
Step 1: Back Up Your Files
The first thing you need to do is make a copy of all your website’s files. To do this, you’ll want to use an FTP tool. If you don’t already have one, FileZilla is an excellent (and free) option.
After you connect to your site’s server via FTP, you’ll need to navigate to your WordPress root folder, which contains all the files on your site. It’s usually called either public_html or www, or is named after your site:
Now, right-click on your root folder and choose the Download option:
This will download a copy of your entire root directory to your computer. The process can take a while, but when it’s done you’ll be ready to move on.
Step 2: Back Up Your WordPress Database
At this point, you already have a copy of your website’s files. Now you need to back up its database, which contains information about your site’s content, users, and more.
To do this, you’ll need to access your database first. Most web hosts enable you to do this through your control panel. For example, if you’re using cPanel, you’ll find a section called Databases. In that section, you’ll want to click on the phpMyAdmin option:
Once you’re in, choose your site’s database from the list on the left, and navigate to the Export tab using the top menu. Select the Quick option under Export Method, and hit Go:
This will download a copy of your site’s database on .sql format.
Step 3: Create a New SQL Database and Import the Contents of Your Old One
Next, you have to create a new database on the web host you’re moving to. Then you’ll import the file from your old database, which will override the new one’s contents.
Assuming that your new web host also uses cPanel, here’s what you’ll need to do:
- Go to the Databases section in cPanel, and choose the MySQL Databases option.
- Create a new database and add a user to it from this same tab (and take note of the names you use for later).
- Access the new database using phpMyAdmin, as you did during the previous step.
- Go to the Import tab within the new database, and upload the .sql file you generated earlier.
That’s it! Now your old database is located on your new web host. However, you still need to re-upload the rest of your site’s files.
Step 4: Upload Your Site’s Files to the New Web Host
For this step, you’ll need to first log into your new server via FTP. Then, navigate to its root folder.
Right-click anywhere within that folder, and select the Upload option. Locate the folder you downloaded during the first step, open it, and select all the files and directories within.
The upload process can take a while, since we’re talking about hundreds of files. If you’re patient, however, you’ll soon find yourself almost at the end of the journey.
Step 5: Edit Your Site’s wp-config.php File
Once all your files are up on the new server, you’ll need to access your WordPress root folder one more time. If you try to actually visit your website now, it won’t work, because you need to update WordPress’ wp-config.php file so that it points towards your new database.
To do this, locate the wp-config.php file within your new root folder, right-click on it, and select the View/Edit option:
This will open the file using your local text editor, enabling you to make changes. Here are the three lines you’ll need to update:
define('DB_NAME, 'db_name'); define('DB_USER, 'db_user'); define('DB_PASSWORD, 'db_pass');
Currently, all three lines will include values that point towards your old database. Go ahead and replace the lowercase variables with the credentials for your new database, which you created during Step 3.
Then, save the changes to the file and close it. You should now be able to access your WordPress website, which will look just as it did before.
WordPress Migration Tools to Make Your Move Easy
Knowing how to migrate a WordPress website manually is useful. As we mentioned earlier, however, there are also some tools you can use to simplify the process. Here are some of our favorites!
Plugin 1: WP Migrate DB
WP Migrate DB enables you to skip the part of the migration process where you need to export your database manually. However, you’ll still need to import the .sql file it generates to your new site by hand. It’s a small timesaver, but it’s still very welcome.
Plugin 2: Duplicator
If you’re looking for a plugin that enables you to automate the entire migration process, Duplicator is one of your best options. It works with any WordPress website, and it takes care of copying both your files and database. You’ll still need to do a few things by hand to get your website set up on its new server, but the overall process is much simpler.
Plugin 3: All-in-One WP Migration
All-in-One WP Migration is one of the most streamlined backup and migration plugins you can find. It enables you to create copies of your site in minutes, and then import them to another WordPress installation using the same plugin. In our experience, it’s perfect for small websites, although it can struggle with larger installs.
Plugin 4: All In One WP Engine Automated Migration
If you’re moving your site to WP Engine, All In One WP Engine Automated Migration can make the entire process a lot simpler. It takes care of everything, from copying your files and database to moving them to the new server. All you have to do is enter some credentials, and the plugin will take care of the rest.
Migrate Your Site to WP Engine
Our main goal at WP Engine is to make your life easier. That’s why we provide you with a dedicated plugin you can use to facilitate the migration process from any other platform to ours. If you’re ready to move your site, all you have to do is choose a plan and follow our guide on how to use our migration plugin!