Transferring a site to a new host can be done in multiple ways. There are many plugins out there that can help you to copy or replicate your site to a new host. The problem with that is that you are relying on these plugins to transfer everything over with out a problem. As we all know sometimes things do not go as we plan. This is why in this article we will focus on transferring our site the manual way. This ensures that we not only understand what is going on but we make sure that we get our site copied over correctly.
In this article we will transfer a WordPress Site from one host to another using the same domain name for the site.
The first thing you will need is the hosting account where you are moving the site to. If you don not have one you will need to get one. If you need a hosting account you can visit one of the hosting companies on the right side bar that we recommend.
We will need to prep the file that we need from your original hosting account. To do this first create a folder on your desktop and call it the name of your website. for this tutorial we will call it “MySite.com”
For this tutorial we will assume that you have your WordPress site installed at the root of your domain. Using an FTP client connect to your existing site and browse to your directory where your site files are in. Usually this would be in the “public_html” or “www” directory.
It should look like this:
For this tutorial we are using FileZilla so on the left side we will browse to the desktop and into the folder that we created “MySite.com” this is where we will be placing our website files from our hosting company.
On the right side select all the files and folders in that directory with the exception of the “cgi” folder and right click and select download. This will copy your current site files from your hosting company locally to your “Mysite.com” folder.
(Be very careful not to delete these files or you will loose your site)
Now that we have a copy of our website files locally the next thing we will need to do is find the database connection settings. Within the folder on your desktop look for a file called “wp-config.php” even though you could open this file by right clicking and selecting open with notepad the file some times shows up garbled. The best program to use is Notepad++ you can get a copy of this for free from here.
After downloading and installing Notepad++ right click the wp-config.php file and open it with Notepad++
Look for this section in the file:
[php]// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
/** MySQL database username */
/** MySQL database password */
/** MySQL hostname */
The 3 fields we are interested in are:
DB_Name, DB_User and DB_Password write down or copy the values of all 3. the values are within the single brackets.
Now close the file.
Now we need to login to your current hosting account and get a copy of your database for your WordPress site.
For this tutorial we are using CPanel
After signing into your CPanel we will look for a section called “Files” and under that you will find “Backups”
On the next page you will see this section:
Under “Databases” click on the name of your database that you wrote down in step 6. This will download a backup copy of your database for your WordPress Site. Save this to your desktop for now. It will be a .zip file.
Now that we have a copy of our site files and a copy of our database now we need to login into our new hosting account and get the site uploaded and installed. After logging in we will kinda repeat step 7 in your CPanel we will look for a section called “Files” and under that you will find “Backups”
In this screen select “Browse” and locate your Database .zip files that you downloaded earlier. Then upload the .zip file.
Now that you uploaded your backup of your database we need to go to the section “Databases” within your CPanel:
and select “MySQL Databases”. On the next screen locate the section “Current Databases” and find the name of the database that you uploaded and write it down
Within the Database screen go to the “MySQL Users” section and create a new user. for the username you will give it the same name as the database. Only give the end part of the database name example in red XXXX_djklefe
Make sure to set a strong password for this DB user and click save.
Now that we have the Database name and we created a database user we need to assign the DB user to the database
On the same screen look for a section “Add User to Database” in the user field select the user you created earlier. In the database field select the name of the database the you uploaded earlier and click “Add” you will be taken to a screen that looks like this:
Make sure to click the check mark in “All Privileges” and on the bottom click “Make Changes”.
Now we need to go back to our folder on the desktop and locate the “Wp-config.php” file and open it. Locate the section that we had in step 6 and update the sections DB_Name, DB_User and DB_Password with your new settings that you have now and save the file.
Now open your ftp client and upload the WordPress site files that you have in the folder on your desktop to your new hosting account to the “public_html” or “www” folder depending on your host.
This should complete the WordPress website transfer process. Provided that you followed these steps and your domain name has resolved you should be able to go to your domain name ex. yourdomain.com and you should see your site.
From time to time we have seen some sites after transfer display a blank white screen. This is usually caused by improper configuration or settings within your .htaccess file. If this is the case you might have to reach out to your hosting company for assistance.