In disciplined software development, you could have a number of site copies; local development, Integration site, UAT, Staging, Live; possibly more, possibly fewer, but always with Live separated from the messy business of development and testing. You can quality control your site and promote changes into Live when ready.
But you need to create a copy of the site to work in; whichever way around you do that is up to you, but the process will be commonly like this...
The advantage of multiple environments on the same server? A common configuration, and common behaviour across Live, testing, staging etc. The downside? An awful lot more clutter to manage; an all your work is on one box, so if that goes down or you trash it, you better have a solid set of backups!
To copy a site:
You can add a new webspace on the server by going to Webspaces, Add Webspace, then add a default domain name for the new webspace; select the IP you want to host the domain on (it will safely use the same IP) and fill in your desired login credentials.
Next, copy everything from the production environment to the test environment:
Go to Websites & Domains and click the name of the website you want to copy, then select Website Copying.
- Select the Website option and choose the destination site name.
- Choose to keep or delete any existing files on the destination server before copying them, bearing in mind if there are any files with the same name on the destination server they will always be overwritten.
- Go to Websites & Domains and select Databases.
- Hit the Copy icon next to the database you want to copy.
- Choose the destination of the database copy.
- If you're copying the database on the same server, select the destination server, the Webspace and enter a new database name or select from existing databases. When doing this in Plesk Panel using 'create a full copy' takes the structure and data; without this option, only the database structure is copied empty of data in the tables.
- Copying the database to a separate server requires you to specify the host name (or IP address) of the remote server to create the new database. Remember if you choose an existing database it will be overwritten!
- The database copying process will start immediately.If you're copying all existing data along with the table structre, it could take a while. Be patient, keep the faith.
- Once the copy has completed, modify your website's scripts in the new environment to they connect to the copy, not the original database; modify the connection strings to connect to a new database name, username and password.You may need to create new database users.