Create a Replica of Content DB and use it as content database of new web application in the same SPFarm
-
24-12-2020 - |
Pregunta
Am having a Single Server Farm Environment wherein I am having 1 WFE and 1 SQL Server machine . in the SQL server box, I have taken a backup of SharePoint's web application's content DB.
Content DB of web web application is
"wss_content_npdwebapp"
.The backup of this content db, I have take is
"wss_content_npdwebapp_june14_backup.bak"
Now my question is, how can I use this backed-up content DB as a content database of another web application in this same server farm? can I create a replica of this content DB? and once this replica is created I can mount this content DB as my new web application's DB.
If I restore it on a new content DB, it won't allow me to do that, as the GUID of existing content DB conflicts with the restored-renamed content DB.
Solución
Yes it's correct, you can't restore a content database to another web application on the same farm because the Content Database GUID is already existing
.
So to overcome this issue, you have to do the following:
- Create your new web application
- Create the root site collection.
- Backup and restore the site collections from source content database to new one using PowerShell
To Get site collections list within content database
Get-SPSite -Limit All -ContentDatabase "Content Database Name" | select url
To Backup site collection
Backup-SPSite https://source-sitecoll-url -Path "C:\Backup\sourcesitecollection.bak"
To Restore site collection
Restore-SPSite https://destination-sitecoll-url -Path "C:\Backup\sourcesitecollection.bak"