Login to FTP with cpanel username either with Filezilla or any FTP program. Navigate to the public_html folder and download the WordPress files including .htaccess on your local computer.
Login to cPanel. Under database options open the phpMyAdmin application.
Select the database that contains your WordPress installation from the list on the left hand sidebar
Once selected, click on the Export tab on the navigation menu in right hand side panel and save the file on your local computer.
Once the database export and the FTP transfer of your files have both completed, move onto the next stage.
Create The WordPress Database On Your New Host Server where you are moving your wordpress website.
Login to the new cPanel account and under database options , click on mysql databases.
Create a new database with an appropriate name for your website.
Create a new MySQL user (with a secure password).
Write down the database name, the new MySQL username and its password. As we will need for further configuration.
Edit the wp-config.php File
Browse to the folder on your local computer where you downloaded your website files to. In that folder there is a file called wp-config.php that controls the access between WordPress and your database.
Make a copy of this file and store it in another folder on your local computer. This is necessary for restoring the changes we are about to make should something go wrong later.
Open the original version of the file with your favorite text editor and make the following three changes.
a. Change The Database Name
Locate the following line:
The db_name portion of this line will currently be set to the MySQL database name of your old web host. This must be changed to the name of the new database you have just created.
b. Change the Database Username
Below this you will find the line:
In this line you need to change the db_user portion from the username of your old host to match the new username you have just created.
c. Change The Database User Password
Finally, edit the third line:
As with the others the db_pass section of this line must be changed to the new secure password you created for your MySQL user.
Import Your Database on the new server.
Login to the cPanel and under database options open the phpMyAdmin application.
- Select your new database from the list on the left hands sidebar. Once it opens select the Import tab from the navigation menu.
- In the File to Import section click the Choose File button and select the SQL file you exported previously on your local computer.
Un-tick the Partial Import check box, make sure the format is set to SQL and then click the Go button. The database import will now begin.
e) You should receive a message informing you of the success of the import when it has finished.
- Upload The WordPress Files To Your New Host
a) Login to FTP with the cpanel username either with Filezilla or any FTP program to your new host server
b) Navigate to public_html folder
c) Upload all the WordPress files from local computer that you downloaded previously which should include the updated version of wp-config.php
At this point you should be just about finished. If you had permalinks setup on your dev site, and you start clicking around the new, live site, you might initially notice that none of your pages are showing up when navigating away from the homepage.
- Login in to your WordPress admin panel
- navigate to Settings
- Permalinks and simply click “Save Changes” so WordPress can create a new .htaccess file on your new server.
Some times WordPress will give you an error message when you try and save your permalink settings, telling you that it couldn’t create an .htaccess file. This just means that you need to go into your web host’s file manager and create a new file, name it “.htaccess” and then make it writeable (permissions 777).
and you are all set !!!!.