Share via


move site collection to another web application

Question

Tuesday, March 13, 2012 9:19 AM

Hi,

Can someone please tell me how I can move a site collection from one web application to another on the same farm?

Thanks,

T

All replies (19)

Tuesday, March 13, 2012 9:29 AM ✅Answered | 5 votes

Hi teen,

yes this is possible using the Backup-SPSite cmdlet in the SharePoint 2010 Management Shell, and then restore it using the Restore-SPSite cmdlet.

An example:

Backup-SPSite -Identity "https://oldwebapp.domain.com/sites/sitetomove" -Path "C:\Backup\sitetomove.bak"

Restore-SPSite -Identity "https://newwebapp.domain.com/sites/newsite" -Path "C:\Backup\sitetomove.bak"

For more information on how to use backup and restore:

Backup:http://technet.microsoft.com/en-us/library/ff607901.aspx

Restore: http://technet.microsoft.com/en-us/library/ff607788.aspx

Kind regards,

Nico Martens - MCTS, MCITP
SharePoint 2010 Infrastructure Consultant
Blog: SharePoint Related
E-mail: Nico Martens


Tuesday, March 13, 2012 9:41 AM ✅Answered | 1 vote

Hi teen,

No, it does not have to exist, if you want to overwrite an existing site collection, you should specify the "-force" parameter in the Restore-SPSite cmdlet.

But, you should make sure the correct managed paths are created before restoring the site collection.
Let's say you have the default managed paths, this means you have a root explicit inclusion and a "/sites" wildcard inclusion. This means you can only restore the site collection either on the root of the web application or the "/sites/newsite".

If you want to restore it to: /projects/newsite, you should create a wildcard inclusion for /projects, or a explicit inclusion for /projects/newsite.

I hope this makes sense.

Kind regards,

Nico Martens - MCTS, MCITP
SharePoint 2010 Infrastructure Consultant
Blog: SharePoint Related
E-mail: Nico Martens


Tuesday, March 13, 2012 10:02 AM ✅Answered | 1 vote

Hi Teen,

When you restore a site collection using the "Restore-SPSite" cmdlet, you have to specify an URL to restore the site collection to.

As you may know, SharePoint uses "Managed Paths" to create the site collection structure used in your SharePoint 2010 environment.

For more information on Managed Paths, i suggest you read this article.

If you did not touch the Managed Paths on your Web Application, you can restore your site using:

Restore-SPSite -Identity "https://yournewurl.com/sites/anyname" -Path "C:\Backup\sitetomove.bak"

If you have any questions, please let me know.

Kind regards,

Nico Martens - MCTS, MCITP
SharePoint 2010 Infrastructure Consultant
Blog: SharePoint Related
E-mail: Nico Martens


Wednesday, March 14, 2012 4:33 PM ✅Answered

I managed to do move the site collection by export and import


Saturday, July 14, 2012 9:00 AM ✅Answered | 1 vote

Hi Mauro,

Yes, you can use the same backup and restore strategy.

Just use the following:

#This is for making the backup
Backup-SPSite "http://example1" -Path "C:\Backup\Rootsitecollection.bak"

#Restore
Restore-SPSite "http://example2/sites/example1" -Path "C:\Backup\Rootsitecollection.bak"

Just make sure Web Application 2 has the "sites" wildcard inclusion managed path.

Nico Martens - MCTS, MCITP
SharePoint 2010 Infrastructure Consultant / Trainer
  


Tuesday, March 13, 2012 9:36 AM

Hi Nico,

Should the "newsite" be an existing site in the other web application?


Tuesday, March 13, 2012 9:48 AM

Nico,

I am afraid I don't understand :(  but I don't want to overwrite an existing site.

Does what you say about the wild card exclusion still apply?


Saturday, July 14, 2012 1:24 AM

Hi Nico,

I have this scenario:

* One web app with a Site Collection: http://example1
* Another web app with another Site Collection in top level site: http://example2

I want to move first site collection into /sites/ in web app example 2 that should be http://example2/sites/example1.

Can I use the same Backup/Restore strategy? What's the sizing limit of the .bak file?

Thank you,

MF


Sunday, July 15, 2012 3:49 PM

Hi, Nico.

Thank you very much.

MF


Wednesday, June 3, 2015 3:28 PM

Great post, thanks!


Thursday, June 30, 2016 7:28 AM

Hi Nico,

From the example you gave above can i replace the two sites i-mean

#This is for making the backup
Backup-SPSite "http://example2/sites/example1" -Path "C:\Backup\Rootsitecollection.bak"#Restore
Restore-SPSite "http://example1" -Path "C:\Backup\Rootsitecollection.bak"
Please reply as soon as possible.Thanks in advance

Thursday, June 30, 2016 8:25 AM

Yes, as long as you have the situation that Mauro describes (but reversed).


Thursday, November 3, 2016 9:22 AM

Hi Nico,

thanks a lot for this helpful post. I also used the Backup-SPSite and Restore-SPSite command to move successfully some sites between different applications.

In the SP farm an additional problem occurs. The AD users seem to have different IDs in the web applications, so if I move a site with user permissions included, the users are not able to access the site any more until I added them again (with the different id, seen as a different user object) in the permission groups. Can this be avoided?

I would ideally like to move the site with all content and e.g. checked out documents with no influence for the user.

Thanks in advance for your help.

Best regards
Sibylla


Thursday, November 3, 2016 9:39 AM | 1 vote

Hi Sibylla,

Can you check if both Web Applications use the same authentication method?

You can do this by going to Central Administration -> Application Management -> Manage Web Applications

Select the Source Web Application and click "Authentication Providers" in the Ribon.

Make note of the "Membership Provider Name".

Do the same thing for the destination Web Application.

My guess is that 1 Web Application is using Classic authentication and the other Claims-based authentication.

Nico Martens
SharePoint/Office365/Azure Consultant


Thursday, November 3, 2016 9:47 AM

Hi Nico,

thanks for this fast reply! You're right, the source web application is using Claims Based authentication, the destination web application has written "Windows" as the Membership Provider Name.

Can this easily be changed? Or are there side effects?

Thanks!
Sibylla


Thursday, November 3, 2016 9:50 AM | 1 vote

Should be no problems when you do it.

If you are not sure, you should do it in your test environment first.

Here is an article on how to convert your destination Web Application to claims based authentication:

https://technet.microsoft.com/en-us/library/gg251985.aspx

Nico Martens
SharePoint/Office365/Azure Consultant


Thursday, November 3, 2016 9:57 AM

Thanks Nico! I will check this out in the test environment.

Best regards
Sibylla


Wednesday, January 8, 2020 7:21 AM

Hi,

What if we dont change the Authentication provider in source, in my case Windows Auth?

Is there a way to update the domain of users now that they are already restored to a new webapp using claims based authentication?

Thanks,

Frances


Saturday, February 1, 2020 9:11 PM

Kindly, Check the below articles