How to Migrate Your WordPress Website To New Host

A simple WordPress migration guide

There are numerous good reasons to switch your WordPress site’s hosting provider. It makes sense to switch to a provider that provides what you want, whether it’s greater uptime, faster speeds, more affordable plans, or better customer service, but it can occasionally feel like a hazardous move or a lot of work.

The good news is that it’s not necessary. We’ll walk you through each stage of the WordPress migration process so you can avoid any time-consuming pitfalls.

How to Migrate a WordPress Website

  1. Sign up to a new host
  2. Back up your website’s files
  3. Export your database from your existing host
  4. Create a MySQL database on your new host
  5. Edit the wp-config.php file on your website’s files
  6. Import your saved database into your new host
  7. Upload your website’s files to your new host
  8. Update your DNS settings

Now, let’s take it one step at a time!

Sign up to a New Host

Prior to actually moving your WordPress website from one server to another, you must select and join up with your new hosting company.

Which host should I transfer my WordPress site to?

It’s possible that you’ve already decided on your new hosting company; in that case, move on to the next stage. However, if you’re unsure of which host to choose, it’s wise to decide what is most important to you before looking into service providers who are experts in that field.

For instance, if you’re unhappy with the uptime of your present provider, you might wish to base your choice of a new provider on a high uptime percentage. Alternatively, if you’re sick of paying a specific amount, you could select a cheaper host.

You may even pick among services that will handle your WordPress transfer, which leads us to…

Which providers will move my WordPress site for me?

We’ve researched a lot of hosting providers in great detail, and there are a few solid options if you want a host that will transfer a WordPress site for you. Namely: ASPHostPortalKnownHost, and Hostwinds.

Back up Your Website’s Files

When you’ve decided on a new host, it’s time to start getting ready to transfer your WordPress site there.

To prevent losing any of your hard work, it is crucial to back up all of the files on your website to your local computer. This is true for everyone, even if your new hosting company is relocating your website for you, since backups are always a crucial safety precaution.

These backups can be performed in one of two ways: by using a file transfer protocol or a WordPress plugin. Although using a plugin is simpler, getting to know file transfer protocols now will be useful when it comes time to upload these files to your new hosting account in step seven.

Using file transfer protocol

By creating a link between the server and the computer, a file transfer protocol (FTP) is a technology that enables you to — you guessed it — transfer files between your previous hosting account and your local computer. Mac users can use Transmit, while PC users can use FileZilla.

Once you’ve set up an FTP software, you’ll need to connect to the server and access your files using a Secure Shell FTP (SFTP) credential from your previous hosting account. After connecting, you can choose and download any file found in the directory of your website.

Using plugins

Using plugins makes backing up your WordPress website simpler. With a few clicks, a plugin can be set up, allowing you to control which files you wish to back up, how frequently backups should occur, and where your files will be kept.

There are more than 57,000 plugins available for WordPress, and many of them were made to help with backups.

There are a ton of possibilities, but make sure you pick a plugin that will backup and restore your site, giving you the ability to restore any previously saved versions of your WordPress website in case something goes wrong. Given that both of the plugins on the left include restoration in their descriptions, we would choose one of them from the list above.

Export Your Database From Your Existing Host

The process of exporting your database is straightforward and is typically carried out using phpMyAdmin, a MySQL database administration tool.

You must first log into the control panel of your current hosting account (the one from which you want to switch). The cPanel control panel, which we’ll use in this example, is what most hosting companies utilize. Your existing hosting provider can assist you if any of the processes differ from those listed below if you use a different control panel, such as Plesk or vDeck, though most control panels function relatively similarly.

In your cPanel control panel, open the phpMyAdmin tool in the “Databases” section.

cpanel dashboard view

Then, from the left hand side of the tool page, select the database you want to export. A new page will load, showing the structure of the database. At the top of this page, select the “Export” tab. You’ll then be able to choose between “Quick” or “Custom” export methods.

Whichever export method you choose, a download window will then pop up and let you save the exported database as a file on your local computer.

Create a MySQL Database on Your New Host

Now that you have a copy of your database saved, it’s time to create a new home for all of those files, and assign a user to oversee it. From the cPanel of your new hosting account (with the provider you’ve switched to), click on “MySQL Databases” in the “Databases” section.

From there, you can name your new database, and it will appear in the “Current Databases” table of your cPanel account. Then, under “Add User to Database,” select the user that you want to add from the User list box, and select the new database from the Database list box. You can then grant the user specific privileges, or select the “All Privileges” check box to grant the user all permissions to the database. Once this is done, click “Make Changes,” and cPanel will add the user to the new database.

Edit the wp-config.php File on Your Website’s Files

Once you’ve created the database on your new hosting account, you can import the old database files that you’ve saved to your computer. But it’s important to edit the wp-config.php file on your local computer first, because it’s responsible for the connection between a WordPress website and its database.

When you first set up your WordPress site with your old host, the wp-config.php file was created based on that old information. To update this information, you’ll need the following details:

  • Database name
  • Database username
  • Database password
  • Database host

You’ll have all of this information after creating the database and user in the previous step.

You can find the wp-config.php file in the folder on your computer where you downloaded your old website files in step two. Open this file in a text editor to make the following three changes.

Change the database name

In the file, find the following line:

database name code

The db_name section of this line will be set to the database name of your old web host, and needs to be changed to the name of your new database.

Change the database username

Next, find this line:

database username code

And change the db_user section from the username of your old host to the new username you’ve created.

Change the database user password

Finally, locate this line in the text:

database password code

And change the db_pass section to the new user password you created in step four.

Import Your Saved Database Into Your New Host

To import your database, you can either use phpMyAdmin or the mysql command line program. We’re going to explain the phpMyAdmin option, because it’s easier to use.

From your cPanel dashboard, click phpMyAdmin under the “Databases” section.

phpmyadmin in cpanel

The phpMyAdmin administration page will appear in a new window. On the left side of the admin page, select the database that you want to import the old file into, then click “Import.” Under “File to Import,” click “Browse,” and select the exported database file from your local computer.

Upload Your Website’s Files to Your New Host

The old files that you saved in step two need to be uploaded now that your new database has been imported.

Connect to your new host using your FTP application, and then look for the folder where your WordPress website will be placed. You can then upload your local computer’s contents, including the revised wp-config.php file, from there.

Update Your DNS Settings

Congratulations on completing the process! You must update your domain’s Domain Name System (DNS) settings to point to the new server IP address once your files have been uploaded to your new host. If you don’t do this, your old host will still be listed in the DNS settings.

You can execute this step with the help of your domain name registrar, but keep in mind that it might take up to 48 hours for your domain to propagate completely. During this time, avoid making any website changes because they will be applied to the outdated version of the site.

You can remove your files and database from your old web host after this 48-hour window has passed.

Rate this post