How to setup a test / staging website?
Previous experiencing with cloning / migrating WordPress websites is necessary.
- Login to your hosting cPanel and file manager.
- Create a “test” folder in “root” directory.
- Copy all files from “root” to “test”.
- Export main website database from the main website via phpMyAdmin (or some other DB management tool).
- Change URL's in database file from http://example.com to http://example.com/test.
- Create a new database and import the file with changed URL's from the previous step.
- Change the database credentials in wp-config.php under “test” folder to connect the test site to a new database.