How to transfer a website to a new domain
Everyone hates moving. Whether you’re moving across town or across the country, packing your belongings and making sure everything ends up in your new home is a daunting task. The same goes for moving your website from one web hosting service to another.
Unlike moving in the real world, you might not know how to move blog posts, images, videos, and other content to the new domain. Do not worry ; we’ll walk you through the necessary steps to make the process as easy as possible.
1. Back up your website
We assume that you have already found a new host and a new domain name for your site. Now you need to pack everything for the move. In this case, that means backing up your website. There are three main ways to do this.
The WordPress method
If you are working with a WordPress powered website, you will need a WordPress plugin to complete it all. Duplicator, UpdraftPlus, and All-in-one WP migration are just three of the many options. These easy-to-use plugins allow you to back up your WordPress site with just a few clicks. Using Duplicator, for example, you need to:
Click on “Packages”, then on “Create a new”. This creates a package that contains all the elements of your site and WordPress, as well as an installer.
Download the site archive package.
Use the installer to open the archive package in your new hosting environment.
Top Rated, Tested Web Hosting Services
The cPanel method
The next level is to use the control panel of a website. Many popular web hosts use cPanel, for example, to manage files. Here’s how to do it:
In cPanel, go to the “Files” section and click on “Backup Wizard”.
Make partial backups of your home directory, MySQL databases, and email forwarders. In a weird wrinkle, you don’t want to create a full backup because you can’t actually restore from it.
Access the cPanel of the new host. Restore each backup file, one at a time.
The FTP method
If you are used to working in the backend of a site, you can back up your site files via File Transfer Protocol (FTP) and phpMyAdmin. You can perform an FTP backup with any FTP client — we recommend FileZilla. In addition, you will need the login credentials from the old site. Here’s how to do it:
Connect with the FTP client or use the file manager built into many control panels and download the contents of the “Public_HTML” folder.
Next, you’ll want to find phpMyAdmin; it is usually found in the “Databases” section of your control panel. Click on the “Export” tab, “Quick” as the export method and “SQL” as the format.
Click on “Go”. This creates a database file that automatically downloads to your PC.
Reverse the two processes on your new domain.
2. Check your DNS settings
Have you acquired a new domain name from an independent domain registrar? Was the new domain part of a web hosting package? Either way, make sure your Domain Name System (DNS) settings are correct.
A DNS record links your domain name to your website and to your server. These DNS records are typically in the form of an IP address, a subset of four numbers (184.108.40.206, for example). There are also general nameservers that come in the form of URLs. You will get them from your web hosting provider. If your registrar and host are the same, you can skip this step. Otherwise, you must add this information to your domain name registrar. Here’s how to do it:
Log in to your new domain server account and verify the server details. It will be in a different location on each hosting provider. This should include your DNS record and your name servers.
Log in to your domain registrar and change the DNS record and name servers to match your new domain.
Wait, as it can take 24-48 hours for the process to work.
3. Transfer files to a new domain
This step is essentially the reverse of the first step. You will need an archive of all the files in your original site’s directory, as well as the database, which tells your web server where all of the content is going. It is important to make sure that both are in the right place.
First of all, you need to make sure that there is already a database created on the new site. (For WordPress sites this will usually be wp-config.php.) Then, using phpMyAdmin, import the contents of the archive file into the existing database. Select the “Import” options in phpMyAdmin, choose the file on your PC and click “Go”. This should import all of the database entries from your old site into the new one. Now you can upload the files to your site.
How to transfer files with WordPress
You will need to use the installer and archive program that you downloaded in the first step.
Use an FTP client or the built-in file manager to connect to your new web host
Click on the installer to begin the restore process.
UpdraftPlus and similar plugins may have a clone or migrate option that allows you to restore everything from a file to your PC.
How to transfer files using cPanel
If you chose the cPanel route, simply go to the backup wizard on your new domain and restore your site from the previously created files. This is the “no fuss, no fuss” option.
How to transfer files via FTP
Use an FTP client or the site’s built-in file manager to connect to your new host.
Download the archive files from your old site’s home directory to the new host’s home directory.
Download your database file. The database file should be on the server for the next step, so upload it now.
4. Make sure to redirect pages
If you want traffic going to your old domain to go to your new one, you need to redirect the old site to the new site. Otherwise, people will see a 404 Page Not Found error when they try to access your site on the old domain. Follow these steps to configure your redirects:
Use FTP or File Manager to connect to the registrar or hosting account for your old domain.
Edit the .htaccess file. This will be in your home directory or in the same directory as your wp-admin folder for WordPress users.
Open the .htaccess file and add the following code:
#Options + FollowSymLinksRewriteEngine onRewriteRule ^ (. *) $ Http://www.newsite.com/$1 [R=301,L]
Replace “newsite.com” with your new domain name.
Now your old domain name should redirect to your new one. If not, you should contact the technical support team at your old hosting service for assistance.
5. Fix all broken links
If you’ve done everything correctly, the links on the new site should work. Some links may point to your old website which no longer exists, so use W3C link checker, Dead link checker, or Dr. Link Check to uncover those broken links. You have to correct each dead link one by one, editing their locations by hand. It’s worth it, however.
6. Notify Google of the site transfer
The last step is to let Google know about your new home! You can do this using some of Google’s own tools.
Recommended by our editors
If you are using the Google Search Console with your old domain, click on the gear icon, then select “Change of address”.
Enter your new domain name here and let Google handle the search traffic redirection.
You will also want to have an XML sitemap for your new domain. If you’re using WordPress, here’s how to achieve it.
Install the Yoast SEO plugin. The plugin will automatically create an XML sitemap at the address: http://newsite.com/sitemap_index.xml. That’s it!
If you are not using a WordPress site, there are other options.
Visit XML-Sitemaps.com to generate one for your new website.
Upload the created file, then use an FTP client or file manager to upload the file to your site’s home directory. The file must be “sitemap.xml”, which means that its URL will be: http://newsite.com/sitemap.xml
Next, under Google Search Consoles, you want to click on “Sitemaps” in the “Index” section. Then you can add the above URL and click “Submit”.
Now Google can easily crawl your website.
7. Check your site
The last step is the easiest: verify your new domain! Take the time to click through to your site to make sure all posts, images, and videos are in their correct locations. Fix all the missing items on your backend.
If you have a fairly popular site, it may be your responsibility to let your community know about the domain change. You may have service disruptions as the migration process progresses, and it’s good to let your visitors know why. Either way, welcome to your new home on the web.
To learn more about web hosting, check out The Best Courses to Learn How to Build Websites. Once your site is live, use these 10 Simple But Powerful SEO Tips To Increase Traffic.