Copying Site Collections with PowerShell in SharePoint 2013 Preview

Posted Sunday, October 21, 2012 10:44 PM by CoreyRoth

I’m working on my PowerShell for SharePoint 2013 (SPC195) talk for SPC12 and I find this new cmdlet so useful I thought I would share it immediately.  The cmdlet is Copy-SPSite and it’s easy to use.  Just run it and before you know it, you’ll have a duplicate of a site collection on a fresh new URL.  You can even optionally specify a new content database.  Here is what it looks like:

Copy-SPSite http://server/sitecollection –DestinationDatabase MyContentDb –TargetUrl http://server/sitecollection2

A successful execution will return nothing at the command prompt.  This is a great cmdlet for developers and IT pros that often need to quickly clone site collections and tear them down. It will take longer for bigger site collections of course.  Try it out today.

Comments

# re: Copying Site Collections with PowerShell in SharePoint 2013 Preview

Monday, October 22, 2012 9:08 AM by Tom Resing

Nice to see they are adding useful cmdlets. Now, how to remember them all with typing help all the time?

# re: Copying Site Collections with PowerShell in SharePoint 2013 Preview

Monday, December 31, 2012 2:00 AM by Osama shatnawi

Thanks

# re: Copying Site Collections with PowerShell in SharePoint 2013 Preview

Thursday, June 5, 2014 6:47 AM by Nick DeAngelo

Thank you - you are a life-saver!

# re: Copying Site Collections with PowerShell in SharePoint 2013 Preview

Wednesday, September 24, 2014 8:41 AM by Jon Sommervold

Thanks a lot Corey!

Do you know if there is an equivalent to this cmdlet in the client side object model (csom)??

...or if there are plans for this in the not so distant future?

Leave a Comment

(required) 
(required) 
(optional)
(required)