The following instructions describe the procedure to clone SharePoint environment from one server to another. The procedure is consisted of the following sections:
- Server operations
- Database operations
- SharePoint configuration
- Configuring Web Applications
- Verification of the procedure
- Take a snapshot of the Source server.
- Install all Windows updates. Install SP1 for SharePoint 2013. The service pack may be downloaded from http://support.microsoft.com/kb/2880552.
- Clone the Source SP 2013 server.
- Remove Virtual network adapter from Cloned SP 2013 VM.
Turn the Clone server on and log in. Navigate to C:\Windows\System32 and start the Sysprep tool as an administrator.
- After Sysprep process is complete, the machine will be in the off state. Turn it on again and login as local administrator.
- Assign static IP address, change Computer name, join the machine into your local domain and then restart it.
- Ensure that the DNS record for the Clone server is correctly set on your local DNS server.
- Login back on Clone server as Farm administrator.
On the Source SP server, stop all SharePoint services
- SharePoint User Code Host
- SharePoint Timer Service
- SharePoint Administration
- SharePoint Server Search 15
- SharePoint Tracing Service
- SharePoint VSS Writer
- World Wide Web Publishing Service
- On the Source SQL server, backup all SP databases.
- Import all SQL logins to the Destination SQL server. On the Destination SQL server, create spservice SQL login and assign dbcreator, securityadmin roles.
- Restore all SP databases on the Destination SQL server.
- Start all stopped SharePoint services.
The following steps are required to set up SQL Server connection aliases on Cloned VM in order to point the web application to the new database server. This procedure must be performed on all servers in the SharePoint Server 2013 farm that connect to the instance of SQL Server that hosts the databases. Before continuing, verify that the user account executing this procedure is a member of the Administrators group and has the db_owner database role.
- Start the SQL Server Client Network Utility, (cliconfg.exe). This utility is typically located in the C:\Windows\System32 folder on Windows Server 2012.
- On the General tab, verify that TCP/IP is enabled.
- On the Alias tab, click Add. The Add Network Library Configuration dialog box appears.
- In the Server alias box, enter the name of the current instance of SQL Server.
- In the Network libraries area, click TCP/IP.
In the Connection parameters area, in the Server name box, enter the new server name and instance to associate with the alias, and then click OK. This is the name of the new server that is hosting the SharePoint 2013 databases.
- Repeat steps a. through f. on all servers in the farm that connect to the new instance of SQL Server
Modify DSN record in the Registry of the Cloned VM. The following image describes the steps on how to achieve this.
On the Cloned VM, run SharePoint Management Shell as administrator and type the following commands. It is strongly recommended to use the same name for SharePoint server as the Cloned server name.
Remove-SPDistributedCacheServiceInstance Rename-SPServer -Identity "[old_SharePointserver_name_here]" -Name "[new_SharePointserver_name_here]
If this command doesn't work try the following:
Open Command Prompt and type: cd C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN
Run the following command:
stsadm -o renameserver -oldservername OldSharePointName -newservername NewSharePointName
Modify the URL path to the Central Administration web site. Into the SharePoint Management Shell type:
New-SPAlternateURL –WebApplication http://[old_server_name]:[central_admin_port] -Url http://[new_server_name]:[central_admin_port] -Zone Default
Run the SharePoint 2013 Configuration Wizard. Check Disconnect from this server farm and ensure that Database server option points to the new SQL server address.
After the wizard is completed, click on the Finish option.
Run the SharePoint 2013 Configuration Wizard and check Create a new server farm option.
In the Specify Configuration Database Settings, please use spservice account
Go through the wizard and create new Configuration database. When the wizard is done, Central Administration portal will start automatically. Click on the Start the Wizard on the Welcome page.
On the Welcome page run the initial Wizard to install all needed service applications. You can use the same service account as on the Source SharePoint server (domain\spservice)
Configuring Web Applications
After the Farm initialization is complete, we need to create new web applications. Use the same port number for applications like on the Source SP 2013 server. Go to Central Administration and open Manage web applications.
Click New button in the ribbon to create new web application.
On the Create New Web Application page please note the database name for newly created application.
You will need to dismount the existing one and mount the database that you have restored from the Source SQL server using the SharePoint Management Shell:
- Now you can test access to web sites on your Cloned SharePoint. This concludes the procedure.