Restoring a site in the same farm but different managed path

I need to restore a site “Sales” within same web application. Here is what I did?

Created a backup of “Sales_DB” using sql management studio. intra.df.suz/Sales
Created a new database “Sales_US” using sql mgmt studio
Created a managed path “SalesUS” with explicit
Ran stsadm -o addcontentdb but it gives following error intra.df.suz/SalesUS

The attach operation cannot continue because another object in this farm already contains the same ID. Each object in a farm must have a unique ID. In order to proceed with the attach operation you mu
st assign a new ID to this database. To attach this database with a new ID, use the Mount-SPContentDatabase command with the -AssignNewDatabaseId parameter. Note that if this new database and an exist
ing database contain the same site collections, attaching this database will likely result in orphaned site collections due to conflicts between the two databases.

=================

  

 

What you want to achieve? You want make a copy of your existing site collection(not subsite) to different path?
– Waqas Sarwar MCSE
Jan 14 ’15 at 19:48

=================

2 Answers
2

=================

When you take a backup of the site it will keep the GUID. This GUID should be unique, then only the application will work as expected.

Hence what you are trying to achieve will not work.

You can probably try using

Export-SPWeb
Import-SPWeb

Also take a look at this Restore a copy of the same site collection insdie the same web application for detailed answer.

  

 

Export-SPWeb does not provide switch to exclude sub webs. I was trying to sites.asmx web services but not sure what string I need to pass to DataPath.
– Morgan
Jan 14 ’15 at 18:29

  

 

msdn.microsoft.com/en-us/library/… provide includesubwebs and this can be set to false so I can just restore root and not everything else.
– Morgan
Jan 14 ’15 at 18:30

Try this:

Create an new Site collection with the URL/Path that you want
[‘http://intra.df.suz/SalesUS’]
(…assuming it is created with a ContentDB named [SalesDB_To_Delete.mdb])

Using powershell:
Mount-SPContentDatabase -Name ‘Sales_US’ -WebApplication ‘http://intra.df.suz/SalesUS’

Next:
Get-SPContentDatabase -Identity ‘SalesDB_To_Delete’ | Dismount-SPContentDatabase

Do iisreset and browse to the site. Once it works, you may delete [SalesDB_To_Delete] from SSMS

That worked for me.

Good luck.