If you’re dissatisfied with your current web hosting provider, switching to another provider has probably crossed your mind at one time or another. Whether you’re having trouble with speed, reliability, customer support, or another aspect of your current web hosting setup, moving to a new provider can help you improve your experience and potentially cut costs.
On the other hand, changing your web hosting provider can be complicated, and it’s easy to lose critical data if you don’t take steps to protect your files. Fortunately, anyone can switch web hosting providers regardless of their technical knowledge. While you can migrate your site to the new provider on your own, less tech-savvy users can take advantage of free migration services from some of the best web hosting providers.
In this article, we’ll walk you through the steps involved in migrating between web hosting providers. Whether you’re planning to migrate manually or use a migration service, we’ll provide all the information you need to achieve a quick and seamless transition.
Step 1. Choose a New Host
Of course, you can only migrate to a new host once you’ve identified the provider that’s right for you.
With so many providers out there, it’s impossible to give a one-size-fits-all recommendation—different hosts come with different pros and cons and are built for sites with different web hosting needs. Pricing, uptime, loading speeds, customer support, and server variety are just a few of the most important factors to consider when you’re looking for a new hosting provider. For a list of web hosts, visit our page on the best web hosting companies of 2021.
Step 2. Decide Whether to Use a Service or Migrate Manually
As mentioned earlier, your approach to switching web hosting providers will depend on whether you’re planning to handle the migration yourself. Free hosting migration tools will connect to the database on your original site and transfer the data to your new provider.
Manual migration is much more complex, and inexperienced users may have a hard time following the entire process. We’ll walk through each of the steps involved in migrating your website.
Pros and Cons of Using a Service
Many hosting providers offer built-in migration tools, so you’ll be able to transfer your site at no extra charge. A service will handle the technical side of the migration based on your specifications. You can generally start the process by simply entering the credentials you use to log into your old provider—your new provider will take care of the rest, so you won’t have to worry about making any mistakes during the migration.
- Less work
- Leave migration to the professionals
- Less control over the migration process
- Some providers may not offer free migration
Pros and Cons of Migrating Yourself
Using a service will make the migration simpler, but you won’t have the same level of control that’s available in a manual migration. While the service may give you some customization options when you start the migration, it simply can’t match the autonomy of migrating on your own. Furthermore, even though the process is more involved, you can easily migrate your site by closely following the steps below.
- Fine-grained control over migration
- No need to trust an outside service to manage migration
- Leaves you responsible for the entire process
- More time-consuming
Step 3. Backup Your Files, Emails, and Databases Before Migrating Yourself
It’s critical to backup your entire website database along with any files and emails before running your migration. While you shouldn’t run into any issues if you follow our guide, it’s always better to be safe than sorry. Once you have a backup on hand, you can start migrating without any risk of losing your files.
Migrating your site requires five steps, excluding the preparatory work of backing up your existing database, emails, and files. First, you’ll need to download your database to your computer. From there, you can create a database at your new provider—this is where you’ll upload the information you just downloaded. Before you do that, however, you’ll have to edit the config.php file in the exported database to prepare it for your new hosting provider.
After that, you just need to upload your files and import your edited database into the new hosting provider. This may sound complex at first, but it’s surprisingly simple when you take it step by step and make comprehensive backups before getting started. Of course, automatic migration is still a more straightforward option if you’d rather leave the migration to your new hosting provider.
Export Your Database
Migrating your site involves exporting your existing database and transferring it to your new provider. When you export your database, you’re downloading it for local access on your computer. Different providers offer database access in different ways, but most people use the phpMyAdmin interface. Of course, you could also use Workbench or any other reliable platform—we’ll use phpMyAdmin for the purposes of this guide, but the process should be similar regardless of the service you’re using.
From phpMyAdmin, just select the database you want to download from the left-hand menu. If you’re not sure which database you need, open your site’s wp-config.php file and look for “define (‘DB_NAME”. The name from your config file should be visible in phpMyAdmin. After that, just click on “Export” to start the export process based on your parameters.
Create a New Database
Now that you have a database ready to plug into your new host, you can set up a new database with your new provider. Once that’s ready, you’ll be able to move your existing database over after making a few changes, which we’ll cover in the next step. We’ll be working with MySQL, but the specifics may vary depending on your platform.
To create a new database, navigate to MySQL databases and set up a database, user, and corresponding password. Make sure to take note of that information, along with the name of the MySQL server you’re using.
Edit the config.php File
While your site’s files can generally be transferred directly to the new host, you’ll need to make some changes before completing that operation. The config.php file is responsible for connecting your database to the files on your site, and it will still be set up for your old database when you export it to the device you’re using. Don’t forget to create a copy of the file before making any edits.
In config.php, you should find a section with “MySQL database username,” “MYSQL database password,” and “MySQL hostname” along with the name of the database itself. Those values will then be defined in the following lines. You’ll need to change that information to match your new database before you can upload the files to your new host.
Upload to Your New Host
With your config.php file set up for the new host, it’s time to upload your files to the provider. Connect your FTP client to your new server’s IP address, which should be easily accessible in the account you set up with your new provider.
Uploading your site files can take some time, so feel free to move on to the next steps while you wait for the upload to finish. At this point, all that’s left is to import your database, switch your DNS server, and cancel your old hosting account.
Import Your Database to the New Host
Finally, it’s time to import your database into your new hosting provider. This process should be similar to exporting an existing database to your computer, especially if your new host uses the same administration tools as the old one.
If you’re using phpMyAdmin, click on the database you want to use, then select the “Import” tab. Simply follow the steps provided on-screen to start the process—the tool should notify you automatically when the upload is complete.
Step 4. Switch Your DNS to Your New Host
With your new host set up, you can finally switch your site’s DNS to their servers. If you got your domain through the hosting provider you’re leaving, their customer support team should be able to help you transfer it to another host. You may need to go back and forth between both providers to complete the process.
On the other hand, if you acquired the domain independently, it’s up to you to change your site’s name-server to match your new host. That process will vary depending on where your domain is registered. You should be able to find the target DNS in your new hosting account.
Websites like IP/DNS Detect, What’s My DNS Server, and What’s My DNS can check your site’s DNS settings to confirm that the changes have taken place. While that process may take 24 or 48 hours, your site will be available at the old DNS until the modifications go into effect.
Step 5. Conduct a Final Check and QA
Don’t forget to perform a thorough test of your site once the operation is complete. If there were any issues during the migration, it’s important to identify them quickly so you can fix the problem before deleting your old hosting account. Of course, you should also keep the files you exported during the migration process.
First, check every page from the old site to confirm that it’s still accessible at the same URL. The page count should match that of the original site, and your database and files should also be accounted for. Consider using a link checker to look for broken links on your newly transferred site.
Furthermore, your host may have added code to your site that’s specific to their practices. If they were responsible for your ads, for example, you’ll need to remove any code that’s associated with their activity. Finally, go through your scripts and forms to ensure that nothing has been lost in translation. You should only cancel your old hosting account when you’re sure that everything is as it should be.
Step 6. Finally, Cancel the Old Hosting Account
Now that your site is up and running with your new hosting provider, you can safely cancel your existing hosting account and cut ties with your old provider. Make sure to do this as soon as possible to avoid incurring any unnecessary charges.
As mentioned above, you should keep your backup files on hand in case of any future issues. While you should have caught any major problems during your final check, there’s always a chance that something will come up later on.