Copying the Database for a Duplicate Site
Adding the New Domain on Plesk
- Navigate to the subscription page for the main domain.
- Click the "Add Domain" button near the top of the page.
- Enter the new domain name under the "Domain name" field.
- Click "Ok".
- If adding the new domain on Web Server 1, complete the following steps:
- On the subscription page, under the new domain, click "DNS Settings".
- Click the domain name under the "Host" header, with a record type of A under the "Record type" header.
- Under the "IP Address" field, enter the IP address of Web Server 1 (103.13.103.69).
- Click "Ok".
- Once redirected, press "Update".
Installing the database
Do not follow this unless copying the database for a website on Web Server 2.
- Go to https://www.web-server-02.com:8443/.
- Navigate to the Subscription.
- Click "Databases" in right-hand side panel.
- Click "Add Database".
- Under "Database name", enter - itip_[domain-name]
- Set the "Database server" to .\SQLEXPRESS.
- Check the checkbox "Create a database user".
- Enter the client's usual Username and Password.
- Check "User has access to all databases within the selected subscription".
- Click "Ok"
Copying the Website
- Remote into the relative server.
- Navigate to the 'vhosts' folder.
- Find and open the folder named [main-domain].
- Copy every file except the 'data folder', 'setup.sql', and the 'site map'.
- Open the new domain name's folder, and then open the folder named 'httpdocs'.
- Delete everything from the opened folder except 'setup.sql'.
- Paste the files copied earlier.
- Open 'web.config' and delete the line inside <connectionStrings>, and then save.
Preparing the Database
- Remote into the relative server.
- Open SQL Server Management Studio and click "Connect".
- Expand 'Databases' by clicking the small plus icon to the left.
- Locate the database named itip_[original-domain-name], and expand it.
- Expand the subfolder named 'Tables'.
- Right click the table named 'dbo.ConfigurationSettings', and select "Edit Top 200 Rows".
- Find the row with the name "Domains" and click the of the first column of that row.
- Press the Delete key.
- Right click the database named itip_[original-domain-name] and go to Tasks > Generate Scripts...
- Click "Next" until you get to the tab called "Set Scripting Options".
- Select "Save to new query window".
- Click the "Advanced" button.
- Change "Types of data to script" to "Schema and data" and click "Ok".
- Click "Next" until you get to "Save or Publish Scripts", and then press "Finish".
- If an error about inconsistent line endings appears, press the exit button to exit the message box.
- Once the script has opened, delete from the very beginning of the script until the line that begins with 'create function'.
- Scroll to the end of the script and delete everything from the line that says 'USE[MASTER]' down (including said line).
- Go to File > Save As.
- Locate the new domain name's 'httpdocs' folder found inside of the 'vhosts' folder.
- Save the file as setup.sql in the new domain name's 'httpdocs' folder (overwriting the file already there).
Creating the Database (To Complete)
- In your web browser. go to the website using the new domain.
