Restore a production sharepoint web farm to a new web farm

Restore a production sharepoint web farm to a new web farm

If you have a production WSS 3.0 sharepoint environment and need to copy the production data into a test environment web farm (different web farm), it can be done using SQL backups and restore.

I am more comfortable using this method than using stsadm tool. This could also be helpful when your production system crashes and you need to quickly get a backup sharepoint farm up and running with the latest production data.

Note: Make sure that you have a database maintenance plan, that backs up your production content databases nightly.

Production sharepoint farm steps

 In SQL Server Enterprise Manager, back up all Windows SharePoint Services 3.0 databases.

Target farm steps ( if you are setting up a brand new WSS 3.0 farm)

1.  Install Windows SharePoint Services 3.0 on the target farm computer. Do not create a web application.

2.  In SQL Server Enterprise Manager, restore to the target farm computer, all Windows SharePoint Services 3.0 databases except the configuration database and the central administrator content database. Use the Restore Databases menu option.

3.  In the Windows SharePoint Services 3.0 central administrator console, create a web application for the portal site. If you have more web applications in the source farm, create the corresponding web applications in the target farm.

4.  In the Windows SharePoint Services 3.0 central administrator console, detach the content database from the newly created web application by doing the following:

5.  From the Application Management page click the Content Databases link under the SharePoint Web Application Management section.

6.  Change the web application from the drop down list.

7.  Select the content database.

8.  Select Offline for Database Status and check the remove content database

9.  Click OK.

10.  Attach the restored site Content database for the newly created web application.

11. On the Application Management page click Content Databases under SharePoint Web Application Management.

12.  Change the web application from the drop down list

13.  Click Add a content database.

14.  Enter the SQL Server name and the name of the restored database.

15.  Click OK.

16.  Start the search crawl from the Search Setting page.

17.  Click OK on the pop up dialog to resume the crawl.

You have now created a brand new web farm that is a copy of the production web farm.

Target farm steps (if WSS 3.0 farm is already Installed  and has web applications)

1. Make sure that you have same number of web application on this target server as the production server. You will need to use this web application for the restore of the production web application.

2.  Go to  Windows SharePoint Services 3.0 central administrator console, select the web application from the web application list.

3.  Select the content database.

4.  Select Offline for Database Status and check the remove content database

5.  Click OK.

6. Go to the SQL Server and delete the content database

7. Create an empty database on the SQL server and name it the same as the content database that you want to restore from the production web farm

8. Restore the backup taken from the production on this empty database.

9. Go back to Central Administration site
10 On the Application Management page click Content Databases under SharePoint Web Application Management.
11.  Change the web application from the drop down list
12.  Click Add a content database.
13.  Enter the SQL Server name and the name of the restored database.
14.  Click OK.
15.  Start the search crawl from the Search Setting page.
16.  Click OK on the pop up dialog to resume the crawl.

You should now have a copy of the production web farm in a test environment.