Changing your web hosting provider can be intimidating, as it’s easy to lose critical data if you don’t take steps to protect your files. But even if you’re not tech-savvy enough to migrate your site, you can use a free site migration service to switch web hosts without a hiccup.
Whether you’re planning to migrate manually or use a migration service, we’ll walk you through the steps in migrating between web hosting providers for a quick and seamless transition.
- Learn how to choose a new host
- Understand whether it makes sense to migrate your website on your own or with the help of a service
- If you do the migration by yourself, see all the steps to take, from backing up files to creating a new database and canceling your old account
How Do You Choose a New Web Host?
When you are ready to switch hosting providers, begin by outlining the reasons you are moving on from your existing service. Remember, it may make more sense to upgrade to a VPS or other solution with your current hosting company rather than migrating to a new one.
If you do decide to migrate, you can use this information to identify the provider that’s right for you. With so many providers, it’s impossible to give a one-size-fits-all recommendation — different hosts come with pros and cons and are built for sites with varying web hosting needs.
Select the best host based on the price range, uptime, loading speeds, customer support, and server variety you need for your website. You can learn more about finding a great web host on our guide to the best web hosting companies.
Should You Use a Web Hosting Migration Service or Migrate Manually?
Your approach to switching web hosting providers will depend on whether you’re planning to handle the migration yourself or have the new hosting company do it for you. 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 you may have difficulty following the entire process if you are inexperienced. 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 can 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 your credentials to log into your old provider. The 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 manual migration
Using a service will make the migration simpler, but you won’t have the same level of control 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
How Do You Back up Your Files, Emails, and Databases Before You Migrate?
It’s critical to back up your entire website database and any files and emails before running your migration. Once you have a backup on hand, you can start migrating without any risk of losing your files.
Migrating your site requires six steps:
1. Back up your site
First, you’ll need to download your database to your computer, backing up your existing database, emails, and files. From there, you can create a database at your new provider, where you’ll upload the information you just downloaded.
2. Export your database
Migrating your site involves exporting your existing database and transferring it to your new provider. You download your database for local access on your computer when you export it. Different providers offer database access differently, but most people use the phpMyAdmin interface.
You can also use Workbench or any other reliable platform. We use phpMyAdmin for this guide, but the process should be similar regardless of your service.
From phpMyAdmin, select the database you want to download from the left-hand menu. If you’re unsure which database you need, open your site’s wp-config.php file and look for “define (‘DB_NAME’).” The name on your config file should be visible in phpMyAdmin. After that, click on Export to start the export process based on your parameters.
3. Create a new database
Now that you have a database ready to plug into your new host, you can set up a database with your new provider. Once that’s ready, you can 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.
4. 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 uploading the files to your new host.
5. Upload it 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. Now, all that’s left is to import your database, switch your DNS server, and cancel your old hosting account.
6. 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, and 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.
How Do You Switch Your DNS to Your New Host?
With your new host set up, you can finally switch your site’s DNS to its servers. If you have your domain through the hosting provider you’re leaving, its customer support team should be able to help you transfer it to another host. You may need to go back and forth between providers to complete the process.
On the other hand, if you acquired the domain independently, you have to change your site’s name server to match your new host. The process will vary depending on where your domain is registered. You should be able to find the target DNS on 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 occurred. While that process may take 24 or 48 hours, your site will be available at the old DNS until the modifications go into effect.
How Do You Conduct a Post-migration 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 them before deleting your old hosting account. 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.
Also, your host may have added code to your site specific to its practices. For example, if the host was responsible for your ads, you’ll need to remove any code associated with that activity. Finally, go through your scripts and forms to ensure that nothing has been lost in translation. Only cancel your old hosting account when you’re sure everything is as it should be.
How Do You Cancel Your 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. Do this as soon as possible to avoid incurring unnecessary charges.
You should keep your backup files on hand in case of 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.