3

How do you move or copy a O365 SharePoint subsite and all of its children subsites in one site collection to another site collection? I have looked at using PowerShell but it does not seem possible without using CSOM. Can anyone guide me?

3

You can use the following to copy site to another site within the site collection Site Setting --> Site Administration --> Content and structure --> Select the site from the left navigation and move

To copy to another site collection: try using copy site as a template (include content) and then use the template file to create a new site under the other site collection

  • Thanks for your feedback but I am trying to move from one site collection to another so the first suggestion would not work for me. Regarding the use of templates, I have tried but I am coming up against path-length and max template size restrictions. – Sheldon May 19 '16 at 13:33
  • Then I would suggest what Eric has already suggested and go with one of the tools out there. Sharegate gives you 15 days free trial (last time I checked) and test if this is going to achieve your req. Good Luck! – Ahmed Mahmoud May 19 '16 at 14:21
  • "Content and structure" has been deprecated in the meantime and is now longer available. Also I believe that with the Sharegate trial not all items are migrated they randomly skip some items inside the stuff you want to migrate/move/copy. – Shihan Jun 25 at 7:39
2

The powershell coverage is weak, so you aren't going to have export options like you would on prem. You would have to create a script with CSOM, as a compiled exe or in powershell, to perform the provisioning and copying data around.

If this is a one off scenario that might be ok, if you foresee the need to do this often, you might want to invest in a third party tool to help you. There are plenty of vendors in this space, like Sharegate, Metalogix, Avepoint, etc.

  • Yes, it is a one-off at least for the foreseeable future. What is happening is that we need to separate content under one site collection and move one part over to its own SC. So i thought that it would be good to use CSOM seeing that SPO PowerShell cmdlets were limited. can you point me in the right direction to use CSOM to move a subsite(s)? – Sheldon May 19 '16 at 13:39
  • I don't have anything to refer to, it is a large, complex operation to create the site collection, copy permissions, copy lists and libraries and pages, with or without versions, and copying files. There are a lot of variables that would be highly specific to your site. I'd really recommend a tool, either sharegate or office 365 essentials from metalogix. – Eric Alexander May 19 '16 at 14:33
2

For SharePoint Online - the way to do this is via PnP :

Get-PnPProvisioningTemplate -Url -Out #to get the provisioning Template

Apply-PnPProvisioningTemplate -Path #to Apply the template to the new site / Site Collection

This will get all of the site columns, site content types, term store, list definitions, (empty) lists, Site Structure and copy them to the new site.

If you want content moved across as well, then that needs more PowerShell, but is doable.

0

Open the site from SharePoint Designer and click on the Save Site as Template option. Then just build a copy from that template.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.