How to Migrate Your WordPress Website to a Different Hosting Provider

Last updated:
Author Jason Moth
Disclosure: When you purchase through links on our site, we may earn a referral fee.
Learn More

WordPress is the most popular content management system (CMS) in the world at the moment, with the platform estimated to power around 36% of all websites on the internet by the company’s own account. The CMS is very flexible, supports loads of different themes and apps, is suitable for any type of website and, unlike rival site builders such as Wix, won’t cost you a thing. That’s right, WordPress is completely free and open-source to boot, which explains why the platform is so popular with novice and veteran webmasters alike.

But while WordPress is a great CMS for building your next website, you do need to pair it with a good hosting provider in order to achieve the best results. WordPress itself recommends going either with Bluehost, DreamHost or SiteGround but the choice is entirely up to you. Similarly, offshore WordPress development services can provide a cost-effective and efficient solution for businesses looking to enhance or migrate their WordPress sites with expert support. Just make sure to pick a reliable hosting provider, otherwise, you’ll probably going to have to migrate your site to a new host sooner or later. Migrating a WordPress website can be a bit of a hassle if you’re not familiar with the process but don’t worry because we’re going to teach you how it works in this step-by-step guide.

Quick Overview

Pretty much all the major web-hosting providers, and even some of the smaller ones, offer WordPress website migration services. Some providers will migrate your website for free while others charge for the service. Each company has its own way of doing doings.

For example, DreamHost charges $99 for site migrations if you’re on a shared hosting plan but the service is free with managed WordPress packages. Meanwhile, A2 Hosting offers free site migrations with all plans, and iPage charges $150 for each site you want to migrate. Bluehost has a similar deal but can migrate up to 5 sites for a total of $150.

If you decide to use the site migration service offered by your provider, the company will take care of everything for you. If you decide to do it yourself, however, there are a few things to keep in mind. Firstly, you shouldn’t try to migrate your WordPress website all at once if you want to do it properly. Instead, you’ll want to migrate your domain name, databases, emails, and your site’s files separately and you’ll need to do these things in a certain order.

This goes without saying but you should sign up with a new hosting provider before you begin the process of transferring your WordPress website from your old host. If you haven’t decided on a new provider just yet, make sure to check out our list of top Bluehost alternatives because most of the companies there are excellent at hosting WordPress sites.

Moving Your Website to the New Hosting Provider

In order for everything to run smoothly, you’re going to need to have access to a file manager or FTP client and a tool for managing databases on both your new and old hosting accounts. Once you’re sure you have access to everything, you can begin the transfer by following the steps down below.

Step 1: Copy Your WordPress Files

Your first order of business is to make a local copy of all files found on your WordPress website. Some providers allow users to make manual copies of their sites and then download them locally, but not all companies offer this feature. If your old provider doesn’t let you download files via the control panel (or charges you for it), you can simply use a file transfer protocol (FTP) client to achieve the same result. If your provider does have a cPanel, follow these steps:

  1. Open the cPanel and find the tool labeled File Manager. There, look for a directory named after the website you want to transfer and open it. If you can’t find a directory like that, look for a directory labeled ‘public_html’. The name of the root directory may vary depending on your provider but you’ll know you found the right one if the files and folders inside have names like ‘wp-admin’, ‘wp-content’, etc.
cPanel Filemanager
  1. Click the Select All option at the top of the list or use your mouse to manually select the files.
  2. Now look to the left-hand side of the window to find an option that allows you to compress all the files you have selected.
  3. Once you select the Compress option you will be greeted by a popup window that asks you to confirm the action. Change the name of the resulting archive if needed and then begin the compression process.
  4. After all your files have been compressed click the Download button to save the archive to your computer.

Note: some web hosting providers (like DreamHost for example) use a custom control panel instead of the regular cPanel. The instructions provided above still apply even when using a custom control panel, however, some of the options (compress, download, etc.) may not be located in the same places as those found in cPanel.

Uploading the Backup

Now that you have a backup of your WordPress website you can upload it directly to your new hosting provider. However, this will only work if your new provider also has a cPanel or some other form of control panel. This is usually the case but you may not have access to a regular control panel at all if you sign up for an unmanaged VPS or dedicated server, so keep that in mind. In order to upload the archive to your new host, follow these steps:

  1. Log into your new hosting account and open cPanel.
  2. Open the File Manager and navigate to the location of your website’s root directory. If this is the first time using the File Manager on this account, the root directly will probably be labeled something like ‘public_html’.
  3. Select the Upload option to begin uploading your site’s archive to the root directory.
  4. Once the upload has finished, select the archive and extract the files to your new host.

If your hosting provider doesn’t have a regular control panel (cPanel or otherwise) or if you’re using an unmanaged hosting plan, you can transfer your WordPress website using an FTP client instead. We recommend using FileZilla but there are a few other good ones out there you could try.

Transferring files via FTP works similar to transferring via File Manager but you’ll have to get used to working with a slightly different interface. Before you can start transferring files, however, you’ll need to create a user with FTP access under your account. Remember the username and password because you’re going to need them to connect to your server.

In order to log into your server using FileZilla, type in the hostname followed by your username and password in the fields located in the upper part of the UI. In this case, the hostname is simply the name of your website but without the ‘www.’ Once you have successfully connected to your server, you’ll be able to download your files following more or less the steps described earlier. If you’re not sure how to create an FTP user, make sure to check your hosting provider’s documentation for details or contact customer support for help.

Step 2: Export Your WordPress Database

Now that you have a copy of your files you’ll also want to make a copy of your database. Most hosting providers allow users to create and manage databases directly from the control panel or via an administration tool known as phpMyAdmin. Your database contains important information about your WordPress website so don’t skip this step if possible. That said, certain hosting providers don’t support databases or don’t include them with all plans. Make sure you sign up with a new host that does support them.

  1. Log into your account and open the control panel.
  2. Find the phpMyAdmin tool and open it.
  3. Look towards the left-hand side of the UI to find a list of all your databases.
  4. Select the database you want to back up and click the Export option from the top menu.
  5. On the next screen select the Quick option (or Custom if you know what you’re doing).
  6. Use the ‘Format’ dropdown menu and pick SQL.
  7. Select ‘Go’ and wait until the exporting process is complete.

You now have a copy of your WordPress database that’s ready to be imported into your new hosting provider’s account. Keep the database near the archive you downloaded earlier so you can have everything in one place, which will make the next steps easier.

Step 3: Create a Database on Your New Account

The next step of the process involves creating a database on your new account. You will use this to import the database you downloaded earlier from your old hosting provider. It’s important that the two databases share the same type. Providers that offer WordPress hosting usually work with MySQL databases so this shouldn’t be much of an issue.

In addition to creating a new database, you’ll also need to create a fresh WordPress database user. Make sure to save the username and password after you create the new user because you’ll need both of them a bit later. In order to create the database, follow these steps:

  1. Log in to the control panel of your new hosting provider and look for a tool labeled ‘MySQL.’ Depending on which hosting you use, the tool may alternatively be known as ‘MySQL databases’ or simply ‘databases’.
  2. Give your new database a name and fill any other mandatory fields, including the hostname if needed.
  3. Create a new database user and make sure to select a secure password. Use a password generator if you want to make it foolproof.
  4. Add the database user to your newly created database and make sure that all privileges are enabled for the user.

Again, not all hosting providers use cPanel but for the most part, these steps should still apply regardless. With that out of the way, let’s proceed to the next step of the process.

Step 4: Edit Your wp-config.php File

If you’ve been using WordPress for a while now, you’re probably already familiar with this file. But just in case you’re not, wp-config.php is a file that contains important information related to the configuration of your WordPress site. Among other things, it contains all the credentials of your site’s database. These credentials are different for every site so this file won’t be the same on your new host as it is on your old one, which is why you’re going to have to edit it.

As for how you can access this file, simply open the File Manager via cPanel or use FTP to connect to your server on the old account first. If you’re using File Manager, you can open and edit wp-config.php directly without leaving the site. If you’re using FTP, you’ll need to download the file, edit it, and then upload it back to your server. If you don’t have an editor that can open the file you can grab Notepad++ for free.

Open the database on your old account and look for the lines of text related to databases, which should include ‘database name’, ‘database username’, and ‘database password.’ Replace all of them with the credentials you created on your new hosting account in the previous step.

If you want to play it safe, which you should, we recommend saving a copy of your old wp-config.php file on your computer just in case something goes wrong. If you happen to change your mind about the transfer, you can use the backup copy to revert to the previous version of the file.

Step 5: Import Your Old Database to Your New Account

If you’ve been following our guide closely so far, you should now have an empty database on your new hosting account and a copy of your old one save locally on your computer. We’re going to use the old database to populate the new one you created during the previous steps.

  1. Log into your new account and open the phpMyAdmin panel.
  2. Open the empty database and look for the option labeled ‘Import’.
  3. Once you click that option you will be greeted by a new window that asks you to select the database you want to import.
  4. Navigate to the location of your old database on your computer and select it once you find it. Make sure that the box labeled ‘Partial Import’ is not checked.
  5. Lastly, click the ‘Go’ button to begin importing your old database.

Step 6: Transfer Your Old WordPress Files to Your New Account

Now that your old database has been imported to your new hosting account, it’s time to do the same to your files. The process is pretty much identical so go ahead and open the File Manager or your FTP client. If this is the first time you’re transferring a website to your new hosting account you’ll want to upload the files to the main root directory. As mentioned earlier, this directory is usually labeled something like ‘public_html’ but the name may differ depending on your hosting provider.

If you already have other websites hosted on the account, you need to move the files to the directory that has the same name as your domain. If such a directory doesn’t already exist, you need to create one yourself. The name of the directory doesn’t necessarily have to be identical to that of the domain but it helps if it is because it allows you to better organize things.

Open the directory and look for the ‘Import’ or ‘Upload’ option. Next, make sure to select the option that lets you import archives (.zip files) rather than individual files or folders. Navigate to the location of the archive on your computer and select it to begin the upload process. This process may take a while depending on the size of the archive and your internet speed so don’t close your browser/FTP client until the upload has been completed.

Step 7: Change Your DNS

Now that you’ve transferred both your files and your database to the new hosting provider, you may also want to consider transferring your domain name. This step isn’t actually mandatory but going through with it is very convenient because you will be able to manage your domain registration and your web hosting from the same account.

Then again, your old provider may charge less for domain renewals than your new one so there are situations when it’s preferable to not transfer your domain. If you want to migrate your site from GoDaddy to HostGator, for example, you may want to keep your domain at GoDaddy because renewals there are much cheaper.

Option 1: Make the Old Name Servers Point to Your New Host

Sticking to the example mentioned earlier, you can continue renewing your domain with GoDaddy but you will need to change its name servers in order to have it work with the hosting provided by HostGator. Different providers offer different means of changing DNS (domain name system) records but the option can usually be found somewhere in the control panel.

Changing DNS records is considered a task for advanced users so you should check the documentation provided by your domain registrar or contact customer support for help if needed. You’ll want to do the same with your new host as well because each host has unique name servers and they can also vary depending on the type of hosting you’re using. For example, VPS and dedicated plans use private name servers while shared hosting plans use generic name servers.

Keep in mind that it can take anywhere between half an hour to a day or more for the changes to take effect and your website is likely to slow down or even become temporarily unavailable during this process. That’s why it’s a good idea to make this change when your site isn’t experiencing a lot of traffic. You may even want to bring your site down for maintenance during the process to avoid providing a negative user experience to your visitors. You should also avoid posting new content or making changes to your website while the process is ongoing, just to be on the safe side.

Option 2: Transfer the Domain to Your New Hosting Provider

While keeping your domain name separate from your hosting provider can have certain advantages, it’s often better to have everything in one place. Transferring a domain name to a different registrar is fairly simple and will usually not cost you anything. But while the transfer itself is free, you will need to pay your new registrar a renewal fee. Also keep in mind that the transfer will only work if your new hosting provider does, in fact, also offer domain registration services. Most providers also act as registrars but there are some exceptions.

In order to initiate the transfer, you will first need to unlock your domain name from your old registrar. First, you need to obtain the EPP code of your domain, which is a randomly generated authorization key that’s unique to each domain name. This code can usually be obtained directly from the control panel, though there may be instances when you’ll need to contact customer support and ask them to give you access to the code.

Once you have this code, disable privacy protection if needed and then unlock the domain name. Some providers have a button that you’ll need to click in order to unlock the domain but others don’t show any additional options. In those cases, all you need is the EPP code and you’re good to go. Once you unlock a domain or initiate the transfer, the registrar will send a confirmation email to the account administrator. Make sure to keep an eye out for that because you may need to confirm the transfer by following the instructions listed in the email.

The final step is to log into your new account and use the EPP code you got earlier to initiate the domain transfer. The process may take anywhere between a few hours and a few days, depending on the registrar. Your site will continue to be live and largely unaffected during this process so there’s no need to take it down for maintenance.

Step 8: Test Your WordPress Website Following the Transfer

Once your WordPress website has been transferred, complete with database and domain name, it’s time to do a bit of testing. In addition to checking your pages and WordPress dashboard to make sure everything looks good, you should also check to see if your domain name has been successfully transferred to your new registrar. You can look up the status of the transfer by using WHOIS.

Go to the WHOIS website and type in the name of your domain. If domain privacy is enabled, the database won’t show any of your personal information, but it will display your domain registrar along with your name servers, among other things. When visiting your website after the transfer it’s a good idea to clear your cache and use a VPN if possible to ensure that everything works properly from any location. Make sure not to cancel your account at your old registrar before you can confirm that your website is working as intended with your new provider and that your domain has been successfully transferred.

Moving Your Email to Your New Provider

Similar to domain names, emails don’t necessarily have to be hosted by the same provider as your website. Once again, though, it’s a lot more convenient to have a single service that takes care of everything. Regardless of where you want to transfer your emails, the process involves the following steps:

Step 1: Create Fresh Mailboxes on Your New Account

Before you choose a new provider to host your emails you should check and see if the company does, in fact, offer this type of service. Most providers tend to display this information on their home page along with other details related to their hosting packages. While you’re researching various hosting options you should also find out if your new host supports the same email protocols as your previous host. Popular protocols include:

Webmail – Just as its name suggests, this protocol allows users to send and receive emails via a web-based interface. With this protocol, you don’t have to worry about downloading your emails and you can usually access your mailboxes directly from the control panel, though some providers have separate portals for webmail.

Internet Message Access Protocol (IMAP) – IMAP is very similar to webmail in the sense that everything occurs online, however, this protocol is mainly designed for reading email rather than sending it. IMAP allows you to easily read emails from multiple devices, provided you have a compatible client installed on each of them.

Post Office Protocol (POP3) – POP3 downloads your emails to your computer rather than allowing you to view them directly on the server. This protocol is meant for those who don’t generally use more than one computer to read emails.

Simple Mail Transfer Protocol (SMTP) – The internet standard communication protocol for sending and receiving email.

Step 2: Configure Your Email Clients

This step is optional if you’re using webmail but if you plan to check your emails using clients like Outlook or Apple Mail, you’re going to have to configure them for the new service. Different hosting providers use different settings so you’ll need to check the documentation or contact customer support to find out how to configure the settings for incoming and outgoing emails.

Step 3: Transfer Email Folders

If both your old and your new hosting provider uses cPanel this step is a piece of cake. Simply log into your old account and download all your email folders from the control panel. Then, log into your new account and upload them. If using cPanel is not an option, transfer your email folders by following the steps below.

  1. Log into your new account and create mailboxes that have the same names as the ones you have on your old account.
  2. While creating the new mailboxes, make sure to set the same passwords you’ve been using on your old ones. These can be changed later if needed.
  3. Log into your email client and create two accounts that share the same name, address, and password.
  4. The two accounts must support the IMAP protocol but they won’t have the same IMAP settings. Make sure one of the accounts uses your old host’s settings and that the other one is configured to use your new host’s settings.
  5. Now simply open the mailbox that connects to your old host and transfer the emails to your other mailbox. You can select multiple emails at once and use the drag-and-drop method to save time.

Step 4: Change Your Mail Exchanger (MX) Records

MX records are part of your DNS record and are used to tell the mail server where to send email messages. Since you’re moving to a different provider you want the MX records to point to the new location of your domain. You can change these records by accessing the DNS manager on your old account.

MX records contain, among other things, the hostname so make sure to change your old host to the new one in the records. A couple of other things you may want to modify are the priority number and the Time to Live (TTL) number. The priority number indicates the order by which various servers will receive emails. Make sure the primary server has the lowest number to ensure that it’s given the highest priority.

If you also change the TTL number to a lower value, the changes made to the MX records will propagate faster across the internet. However, doing so might also slow down your website so you’ll want to revert back to the original settings once everything has been transferred to the new hosting provider.

Step 5: Test Your Email

Your last order of business is to test your mailboxes once the transfer has been completed to make sure that everything is working as it should. In order to properly test your mailboxes, send test messages from a third-party account such as Gmail or Yahoo! Mail. Then, reply back to these messages from your domain mailbox and check to see if everything looks good. You’ll want to repeat this process for each mailbox you transferred just to be on the safe side.

Final Thoughts

The process of transferring to a new hosting provider may seem a bit complicated to some users, but you shouldn’t run into any issues if you closely follow the steps described in this guide. Before starting the transfer, you may want to read the guide a couple of times until you’re sure you understand how everything works. You’ll also want to check with both your current and the new provider to see if they support things like cPanel, FTP, MySQL databases, webmail, and DNS management.

Leave a reply
Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted.