During a production SharePoint site cloning into UAT using Database attachment method, after attaching the content database to the web application in UAT environment, found the current current number of site collections is 0 (zero). All site collections missing! Tried "View All Site Collections" from SharePoint 2013 Central Administration site, found nothing! No site collections listed.
- As a first step in troubleshooting, installed patches to the UAT environment to bring it on the same patch level.
- Tried upgrading the database: Upgrade-SPContentDatabase <database_name>
- Tried refreshing the site map in the config db:
$Database = Get-SPContentDatabase -Identity "Database_Name" $Database.RefreshSitesInConfigurationDatabase()
- None of the above helped! Finally, tried running Test-SPContentDatabase and found the answer!
Test-SpContentDatabase -name "WSS_Content_KM_New" -webapplication http://intranet.crescent.com -ServerInstance "Abj-SQL-001" > Result.txtand the output of the above was the answer:
Site Collection GUIDs are unique to the SharePoint farm. So, If a content database is restored even to a different Web Application on the same farm - Site collections will not appear if the farm has a duplicate GUID of the site collection. In my case, this issue was raised because of the errored content database in a previous attempt!
- Delete the existing site collections which are causing the conflicting GUIDs issue from the LOG file above.
- Detach the existing content database which is triggering the duplicate issue.
- Take the backup of the site collection and restore it a different web application using again PowerShell/STSADM. How to Copy site collection in SharePoint
You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.