Skip to content

Create a SharePoint Web Application from a SQL database backup

October 4, 2013

To set a new environment from a database backup there are some step that are necessary to follow. The first step is restoring the SQL database backup.

  1. Verify that the user account performing this procedure is a member of the sysadmin fixed server role.
  2. If the Windows SharePoint Services Timer service is running, stop the service and wait for several minutes for any currently running stored procedures to finish. Do not restart the service until after you restore the content databases.
  3. Start SQL Server Management Studio and connect to the database server. Expand Object Explorer, right click on Databases and select Restore Database.
  4. On the Destination for restore add To database name, e.g., WSS_Content_80.
  5. On the Source for restore select From device and point to the backup file.
  6. Click on the restore check box.
  7. Click OK to complete the recovery operation..
  8. Start the Windows SharePoint Services Timer service.

The next step in the process is creating your Web Application, if you haven’t any yet, to host our Site Collections.

Note: The Web Application must be empty, with no Site Collections added, otherwise this will not work as it should!

  1. Open the Central Administration.
  2. Under Application Management, click Manage web applications.
  3. On the Web Applications tab, click New.
  4. Set the IIS Web Site Port
  5. On the Database Name and Authentication group set append the selected Port to the end of the Database Name.
  6. Select OK to initiate the creation process.
  7. Click OK.

Our new Web Application will now be listed alongside our SharePoint Central Administration V4 Web Application under Central Administration/ Application Management / Manage web applications.

Open the SharePoint 2010 Management Shell with administration privileges and execute the following command to test the content database.

  1. Execute the script:
    Test-SPContentDatabase –name [SPContentDatabase] –WebApplication http://[server]:[port]/
     [SPContentDatabase] – in this example I’ll use WSS_Content_80
  2. This is what you will see after executing the command line.You’ll see that you get an error, but this is more like a warning and does not affect anything on the site.
  3. Change the above command line to Mount-SPContentDatabase –name [SPContentDatabase] –WebApplication http://[server]:[port]/.

Note: you can have more information about Test-SPContentDatabase and Mount-SPContentDatabase here and here.

The content database was successfully attached to our Web Application and before accessing the site we only need two more steps.

  1. Go back to the Central Administration.
  2. On the left menu click Application Management.
  3. Under Service Collections group, click on Change site collection administrator.
  4. Change the Primary and Secondary Site Collection Administrator for users from your network.
  5. Click OK.

Now it is time to open your browser and you’re good to start using it.

Advertisements

From → SharePoint 2010

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: