How to create a Wordpress staging sub-domain on Plesk


Note: This is an advanced guide and may take 1hr+ to complete. Please note that if the steps are followed incorrectly and the site fails to load, our support team will not be able to investigate or fix any development problems. If required, we could perform a manual migration to carry out these steps on your behalf. You can find more information in this guide.

The information in this guide is provided as a suggestion, and we can't provide detailed support for modifications to a Content Management System. If you require assistance with this, we'd recommend speaking to your website developer to ensure relevance and compatibility with your site.


Step 1 - Decide what domain you'd like to use for your staging site. We'd recommend creating a subdomain like 'dev.yourdomain.net.au'. If you'd like to use something else, you can modify the provided steps as needed.


Step 2 - Log into Plesk and create a subdomain for 'dev.yourdomain.net.au'. We have a guide on this process here.


Step 3 - Open the File Manager.

24dbd3cc0f3723d2adececfcea13176b2d856030?t=cc3b5f02d87eb329f63bdd483836ebf8


Step 4 -
(1) Navigate to the httpdocs directory (or the folder that is currently hosting the live website).
(2) Click on the Select All button.
(3) Click Copy.

de9177ab4059f1a015586a3849657ad8fa8e64ff?t=18da8d33c401eca94c2c4d29807dc3d2


Step 5 -
(4) Click on dev.yourdomain.net.au (Or the place where your staging site files are going to be stored).
(5) Select Replace Existing Files.
(6) Click OK.

348346fc71ccd173c78cf9df6bf8b7515b83e75f?t=b3a0fea682c79a38139aa6ede326e72a


Step 6 - Navigate to the Databases section and create a new, blank database and user. Click here for a guide on how to do this. Make a note of the newly created database name, username and password somewhere on your computer.


Step 7 - Navigate back to the Files section of Plesk.
(1) Enter the sub-domain folder (dev.yourdomain.net.au in this case).
(2) Click on the wp-config.php file.
(3) Click on Edit in Code Editor.

6d7ff879c50e63b4313d9929aaf1bccc679d09a1?t=030b4d46a096ac0a92a9f2ab9d9468d1

Step 8 - Find the lines relating to the MySQL database username and password.

wpmanmig08a.png



Step 9 - Replace the existing database details with those of the database and user you just created.

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

Database Name:
yourdoma_wp01
User: yourdoma_admin
Password: Password123!!!

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

3a999d7c3e0117269f87a87b93da25e71f628e6b?t=88d09aa0adf4bc530d7f595fb935bb64

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

a7000506321c45f759f14e3bf9a91ca14855bc0b?t=4bf61b6f5b417a15879a3d5b5eb22a04


Step 10 - Export the live site's database into an .sql file, then Import it into the new, blank database you created. You can use this guide to export and import databases.

If you don't know which database belongs to the live site, you can navigate to the Document Root you copied the files from (Step 4), then open the wp-config.php file (Step 7) to check the DB_NAME.

eb81f47126739f09896fc2d5e2aee222d28504b4?t=e2f196075e5813d7113d39e01d01601d


Step 11 - Finally, you will need to update the primary URL associated with the Wordpress installation (from, for example, yourdomain.net.au to dev.yourdomain.net.au). Click here for a guide on doing that.

Note:
The login to the admin section for the live site will be the same, but there will be a different login link available as well. If you previously accessed the admin panel using, for example, yourdomain.net.au/wp-admin, the new link for the dev site will be dev.yourdomain.net.au/wp-admin. Try /wp-login.php if you get an error when going to /wp-admin.

You can now start work on your development site. Once you are ready to bring this site live, you can use this guide to do so.


For more tutorials on website development and Wordpress troubleshooting, view our List of Wordpress Guides.


Did you find this article useful?