I have got a .bak file (database backup) of a SharePoint environment. However when I restore this file in the database and add this db as a content database I get "0" site collections. What am I doing wrong in this? am I using this the wrong way?
2 Answers
Before adding it to the server, launch the Test-SPContentDatabase script on the restored content db.
If you got errors, then check your restored db and try to fix the errors, or sometimes, it might be just a corrupted backup, try to backup it again.
If everything is ok (just got warnings), then launch the Mount-SPContentDatabase to mount your content db with a web application. It should go fine.
-
I tried Mount-SPContentDatabase. It mounts but it gives the Current Number of SiteCollections as 0. I know there should be more than 1 site collection in this backup. Just to test things out I created a site collection under a different web application. Took a backup of the database using SQL Server Management Studio. Then restored the database under a different name using SQL Server Management studio and finally mounted the database to a different web app. I still get 0 site collections. I think I am missing a step here. Mar 18, 2015 at 10:17
-
Did you run the Test-SPContentDatabase command ? Try it please before the Mount-SPContentDatabase and check if there are no issues.– KhalilGMar 18, 2015 at 10:50
the SharePoint farm service account must be a member of the SQL Server dbcreator fixed server role. To attach a content database to a Web application, the SharePoint farm service account must have db_owner permission for the content database.
Ref : For more information