Creating Web Application from Existing Content database in your Microsoft SharePoint On-premise
As part of your Microsoft SharePoint on-premise development or Administration role, you may want to copy one of your web application from one Microsoft SharePoint Farm to another. This article describes the quick process for the same.
In order to start our association with one of our client for their Microsoft SharePoint application development and support, client’s administrator sent us content database and custom solution source code. Our goal was to create a local development environment so that we can start helping our client.
- We need farm administrator access to destination Microsoft SharePoint Farm.
- We need windows or sql server account having db_owner role on all database of destination farm’s Microsoft Sql Server.
- We need content database backup created from sql server.
- We need zip file of all the custom wsp solutions being used in the source farm.
Step 1 – Restore content database backup to destination farm sql server
- Connect to your Microsoft Sql server using Microsoft Sql Server Management Studio with credentials having db_owner role.
- Go to object explorer right click on databases and click Restore Database in the context menu
- Select device from the menu and choose the database backup file that you received.
- In the database selection choose to create new database and give it an appropriate name.
For more detailed documentation on how to restore database backup to a new database, see this article from Microsoft online docs.
Step 2 – Create web application in destination farm
- Connect to SharePoint Central Administration
- Click on Web Applications section and click on option to add new web application from ribbon command.
- The trick here is to ensure you choose the existing database that you restored while creating a new web application.
- This will ensure SharePoint will pick up all content from there instead of creating new database.
Step 3 – Final steps before validation
Finally, we will need to perform following steps before we can hit the restored web application in Microsoft SharePoint.
- Connect to SharePoint Central Administration > Application Management > Content Database
- Choose your web application that you created in step 5 and it will show you database that you restored if you have performed all the steps correctly.
- Next you must change site collection administrator for the restored web application. In order to do that, go back to application management > Site collections section > click Change site collection administrator link.
- Choose your web application and then one by one choose each site collection and set site collection administrator to yourself.
- Next, use powershell to add all custom wsp solutions to your farm and deploy it to your web application and/or site collections as per their scope.
Step 4 – Validation
Start accessing site collection one by one and activate all site collection features and site features from the custom solution that you are required to ensure all features of the restored site collection are working properly.
It is always challenging to move applications from one farm to the other farm, specifically when they are depending upon other service applications. In spent last two weeks to learn how to properly do that. I hope this will help you at some point during your Microsoft SharePoint development.
What challenges are you facing in your Microsoft SharePoint development?