Moving WordPress from a staging/dev domain to a live one in cPanel


How to move WordPress from a staging/dev domain to a live one in cPanel

PLEASE NOTE: This is an advanced guide and requires following all the steps carefully. Try to set at least 1hr to complete this process fully.

Step 1 - Log into cPanel (click here for a guide) and open the File Manager

Step 2 - First we need to move files from the testing folder to the root folder (normally the public_html folder). Find and go into your staging folder then (1) click on Select All (2) right-click (Windows) or control+click (Mac) anywhere on the highlighted area and (3) click Copy

Now (1) change the folder to /public_html/ and (2) click Copy Files

Step 3 - Go into the public_html folder and (1) Find the wp-config.php file and right-click (Windows) or command+click (Mac) then (2) click on Edit

Find the lines relating to the MySQL database username, password

Step 5 - Keep the page with the wp-config file open. Open a new cPanel Window and use the MySQL Database Wizard to make a new database and user. Click here for a guide on how to do this. Make sure that you write down the newly created database name, username and password somewhere on your computer, like in a notepad or text document.

Step 6 - Go back to the wp-config.php file in Edit mode. Now you need to edit the database details.

If, for example, you set up a database with the following details:

Database Name: aputhe_wp01
User: aputhe_admin
Password: Password123!!!

Then your wp-config.php file will look like this:

Make sure to hit Save Changes to update the new database details.

Step 7 - Now you need to do 2 things:

A) Export the database .sql file from the old database

B) Import the .sql file into the newly created database

Make sure to check the wp-config file for the correct name of the old database. Click here for our guide on importing a database using the cPanel tool PHPMyAdmin.

Step 8 - Next you need to do is update the domain name (from, for example, to Click here for a guide on doing that. Note that the login to the admin section has changed. If you previously accessed the admin panel using, for example, the new link will be (try /wp-login.php if you get an error when going to wp-admin)

That's all done now! If you completed all the steps correctly, the WordPress site should now be working from the main page.

Once your site is ready, you will want to make sure that WordPress and its themes and plugins are updated to the latest version (click here for a guide) as this can improve both the speed and security of your website. Once updated, go back into cPanel and update the PHP version to a higher version and see if the site works. Newer versions of WordPress and its themes/plugins are designed to work most efficiently with more recent versions of PHP, and older versions will run slower.

If you find your WordPress website is running slowly, click here for our guide on speeding up WordPress.

You might also want to set up WordPress with SSL. Click here for a guide on how to do that.

Related Articles

  • Comments

Add Comment

Replying to