How To Move WordPress To A New Server Or Host
It seems as though the easy part is transferring the files. What most people find difficulty with is moving their WordPress database to the new server or hosting company.
While there are other tutorials available online, many seem to lack clear instructions on how to move your blog. In this tutorial, I’m going to take you step-by-step and show you exactly how to move your WordPress blog to a new server or host.
It may look difficult at first with all the steps I’ve included, but I assure you- it’s easier than it looks- especially after you move a blog a few times. It may seem like there are many steps to moving your WordPress blog to a new server, but there really aren’t that many. I’ve just broken each step down to make it very clear even to beginners exactly how to move their WordPress blog.
So, are you ready? Here we go:
Open either your FTP program or your file manager through your hosting company and browse to your home or public_html directory. With WordPress installed, it should look something like this:
You want to download all the files and folders to a convenient location on your computer, then upload all the files and folders to your new server/host.
Once you have all the files on your new server/host, you need to download a copy of your original WordPress database from your original host.
(All of the following screenshots were taken from cPanel, but if your host uses a different administration panel, the steps will be the same- they may just look slightly different.)
Once logged in to your administration panel, go to phpMyAdmin.
Once you click phpMyAdmin, in the left column click on the database that is used for your original WordPress blog.
You should now see the name of the WordPress database in the drop-down box and all the WordPress tables listed underneath. The tables you have can be different than mine because the WordPress plug-ins you use will determine what tables you have in your blog’s database.
Regardless, it should look something like this:
Now in the main window, click the tab at the top of the screen that says “Export”. In the “Export” box, all of your WordPress database tables should be highlighted.
Underneath that, check the box that says “Save as file” and name it whatever you want, then click “Go” to download your blog’s database.
Click the “Save” button to save a copy of your WordPress database to a convenient location on your computer.
Congratulations! Now you’re done with your old server/host! It’s time to move on to the new server/host.
Login to your new server/host’s control panel. The first step is to create a new database that will be used for your new WordPress Blog.
Click on “MySQL Databases”.
Under “Create New Database”, enter a name for your new WordPress database, then click the “Create Database” button.
Now that your new WordPress database has been created, we need to make a new user for that database. Usually on the same screen you’re at, you have the option to create a new user.
Enter a name and password for the WordPress database user and click the “Create User” button.
Now you have to give that user permission to use your blog’s database. Again, usually on the same screen you will have the option to add that user to the database. Select your WordPress database and the user you just created, then click the “Add” button.
On the next screen, you have the option to grant which permissions this user has to your blog’s database. Be sure to grant this user total access to the WordPress database by checking “All Privileges”, then click the “Make Changes” button.
You should get a confirmation telling you that the user has been successfully added to the database.
Now that your new database has been created, we need to import your old WordPress blog’s database contents into your new database.
Back in the main window of your control panel, click on “phpMyAdmin”.
In the drop-down box in the left column, select your new WordPress database that you’ve just created. It should say that there are no tables in the database yet, since it’s a blank database that you’ve just created.
In the main window, click the “Import” tab. Under “File To Import”, click the “Browse” button and select the .sql file that you downloaded from your old WordPress database, then click the “Go” button.
After waiting for the entire blog’s database to import, you should get a confirmation telling you that the tables have been successfully imported. Again, the number of queries that were executed may be different than mine, depending on which plug-ins you have installed.
Now in the left column, you should be able to see all the WordPress tables that were just imported.
If your new WordPress blog is using a different domain name than the original, we need to modify three values, and they are all located in the “options” table.
Even if you are using the same domain name, there is one option you may have to change. I would recommend you continue to follow along, even if your new WordPress blog is using the same domain name as the original blog.
All of the changes we need to make are located in the options table. My options table is named “wp1_options”, but yours may be a little different (probably “wp_options”), just as long as the suffix is “options”.
After you click on the options table, click the “Browse” tab at the top of the page.
One of the option names will be “siteurl”. You will see that your original domain name is listed. If your new WordPress blog is on a new domain name, you need to edit that value to your new domain name.
You can do so by clicking the “Edit” button, which looks like a pencil.
Once you click the “Edit” button, just enter your new blog’s URL and then click the “Go” button to save the changes.
The next two values we need to change are usually located on page 2 of the options. At the top and bottom of the main window, you should see the heading “Page number” with a drop-down box. Select page 2.
Scroll down until you see the “home” option. Again, you will see your old WordPress blog’s URL. Click the “Edit” button which looks like a pencil to modify the old blog’s URL.
After you click the “Edit” button, enter your new WordPress blog’s URL, then click the “Go” button to save the changes.
The third and final value we need to change is the upload path. This is the location where WordPress will upload all of your images.
Scroll down until you see the “upload_path” option, and again click the “Edit” button that looks like a pencil to modify this value.
Now you need to enter your new upload path. The only part of your new upload path that you need to modify is the username that your hosting company gave you for your domain name.
This is usually just after “/home/”, and in my case is “jrivnet”. Replace this with your new username. This is usually the username you use to login to cPanel, or your domain’s control panel.
If you are still unsure as to what it is, take a look in the left column. Your username is the prefix of your WordPress database. Notice how mine is “jrivnet”.
Once you’re done with that, click the “Go” button to save.
WHEW! You’re finally done with all the database stuff! Your final step is to go to your wp-config.php file of your new WordPress blog. This is in the root folder of your WordPress blog (usually /home/ or /public_html/). You can do this with your FTP program or the file manager for your new WordPress blog through your hosting company.
Find the file “wp-config.php” and click “Edit”.
Once the “wp-config.php” file is opened, the first things you will see are:
DB_NAME, DB_USER, and DB_PASSWORD.
Enter your new WordPress blog’s database name, username and password between the ‘ ‘. Look at the 13th image in this article above just below where I said “You should get a confirmation telling you that the user has been successfully added to the database”. That was my new WordPress database and username that I created. The 10th image in this article is where I created the user’s password.
This IS NOT your WordPress admin username and password! This is your database’s name and password which you just created for your new host/server.
Once you enter the new information, save the updated “wp-config.php” file.
You can now go to your new WordPress blog’s URL admin login (i.e. example.com/wp-admin) and login using the same username and password you were using on your original WordPress blog.
That’s about as simple as I can explain the process of moving your WordPress blog to a new server or host. If you have any problems, feel free to post your comment below and we can all do our best to help you along.