It can be perplexing to move a WordPress website to a new host. There are quite a few steps, and if everything isn’t done correctly you could lose data or suffer downtime. There are a couple of ways you can go about migrating your site to a new host. If you’re a pro and are familiar with MySQL, I recommend you use the first method. If you’re a bit on the novice side, use Method 2. This tutorial does assume that you know your way around FTPing into your server and doing a few things in cPanel though.
Let’s get to it.
Use this method if your domain will not be changing. That is, you have yourdomain.com, and will still be using yourdomain.com with the new host.Â If your domain will be changing or you are moving from a blogging service, you may want to use Method 2 as using this method transfers domain specific data that won’t apply to the new domain.
Getting data from your old server
1.1. Login to the old server via FTP and download the files for your site to your local computer. In most cases, you can simply grab the entire domain folder, and drag it to your Desktop.
1.2. Login to the old server’s cPanel or other interface and access the database for your site. In most cases, you are using MySQL and can access your database by opening phpMyAdmin.
1.3. Export your database to a file. If you’re using phpMyAdmin, select the “Export” tab. From there you can select the database that contains the data for your site, check the “Save as file option”.Â If you have a rather large site, you may want to select the “gzipped” option so the file is compressed. Select “Go” and a single file will then be created that contains all of the data in your database.
Note: Don’t worry about exporting the information_schema database.
Now you have the files for your site in a folder on your computer as well as a file that contains your site database. You’re ready to move them over to a new place.
Setting up the new server
2.1. Login to the cPanel or other interface your new web host provides and add the domain to your new server. In cPanel, this is done by going to the “Domains” area and selecting “Addon Domains”.
2.2. Once you have added the domain, login to your new server via FTP. A folder should exist on the new server for the domain you added. In some cases it will be named “yourdomain.com”, or it could be a folder named “public_html”. Copy the files you downloaded in step 1.1 to this folder. Make sure the folder structure is the same as it was on your old server.
2.3. While the files are copying, login to cPanel or other interface for your new web host and create a database. In cPanel, this is done by going to the “Databases” section and selecting “MySQL Databases”. While creating the database, be sure to take note of the database name you used.
2.4. Once you have created a database, you will need to create a user account for the database. You can do this also in the “MySQL Databases” section of cPanel. Be sure to take note of the username and password you use.
2.5 Add the user to the database. In cPanel, this is also done from the “MySQL Databases” section. Be sure to grant the account “All privileges” to the database.
2.6. Now that you have the database and user created on the new server, you are ready to import the data from the file you downloaded in step 1.3. Open the database. Once again, this is normally done via phpMyAdmin. Select “Import > Choose File > select file from step 1.3 > Go”. Your database should import and be ready to use on the new server.
2.7. Open the “wp-config.php” file, located in the files you downloaded from your old server in step 1.1. Modify the “DB_NAME” (database name), “DB_USER” (database username), “DB_PASSWORD” (database user password), and “DB_HOST” (normally just ‘localhost’) to match what you are using with the new server. Save and upload the file to your new server, overwriting the existing wp-config.php file in your domain folder.
2.8. Login to the service that provided your domain. For most of you, it will be GoDaddy. Navigate to the section where you modify the DNS settings for your domain, and point them to the nameservers for your new host. If you don’t know the nameservers for your new host, you should be able to obtain them from the Support department of your new web host, or by doing a web search.
At this point, you should have two operational servers. One at your old host, and one on the new host. Check to make sure everything is working on the new host. You haven’t pointed your domain to the new location yet, but your new host should provide a temporary URL you can use to check to see if the new site is working before you make the switch official. Make sure the site displays properly. If you get database errors, double-check the wp-config.php file and make sure everything is setup correct.
You are now ready to make it official. Login to the service that you purchased your domain from (Commonly GoDaddy) and point your domains to the new host’s nameservers. This process will take a couple of days to complete. So be sure to keep the site up and running on the old host. Once 72 hours have elapsed, you should be able to officially cancel your account with the old host.
If you’re using WordPress on a third-party site like WordPress.com or another place where your domain will be changing (i.e. myname.theirdomain.com to myname.com), use this method.
Getting data from your old server
3.1. If possible, login to the old server via FTP or other file transfer method your old host offers and download the files for your site to your local computer. In most cases, you can simply grab the entire domain folder.
Note: If you are transferring your WordPress site from a blog service like WordPress.com, you may not have access to your images and other files. Some blog services may offer to move your data to your new server for a fee. Explore your options accordingly.
3.2.Â Login to your WordPress account on the old server, then go to Tools > Export > Download Export File. This will put all site settings, content, and comments into the file. Images are not included in this export.
Setting up the new server
4.1.Â Install WordPress on the new server.
4.2. Copy the files you obtained in step 3.1 to your new service via FTP or other file transfer method as offered by your new host.
4.2. On the new server, go to Tools > Import > WordPress > Install NowÂ > Activate Plugin & Run Importer to install the importer.
4.3. Select Choose File, then navigate to the file you downloaded in step 4.1.
4.4.Â Login to the service that provided your domain. For most of you, it will be GoDaddy. Navigate to the section where you modify the DNS settings for your domain, and point them to the nameservers for your new host. If you don’t know your nameservers, you should be able to obtain them from the Support department of your new web host, or by doing aÂ web search.
If you’re moving from a third-party blogging service like WordPress.com or Blogger, you will want to research if there are ways that visitors can be forwarded to the new URL automatically.
Your new WordPress site should be ready to go.
2 thoughts on “How to Move Your WordPress Site to a New Host”
Or you could use a tool like ManageWP to make life really simple! Check it out at https://managewp.com.
Harjit– Are you saying that this program will help migrate sites from WP.com to WP.org?