SOLVED

Change a Modern SharePoint subsite to its own site

Contributor

I have a modern SharePoint site that I am using as a 'template'. 

What I am actually doing is copying the content from the parent site to a subsite.

 

What I end up with is a URL looking like this: https://admin.sharepoint.com/sites/MyTemplateSite/CreatedSubSite

 

I want to know if I can take the subsite and make it independent of the parent site:

https://admin.sharepoint.com/sites/CreatedSubSite

 

From my research I see that I can change the URL of the subsite, but not make a subsite independent of the parent site.

 

I am happy to use PowerShell to facilitate this change.

 

Any help appreciated.

Che

12 Replies

Hello @CheWeigand

 

the only thing that i can find is this article about "Promote subsite into site"

https://sharegate.com/blog/move-subsite-top-level-site-sharepoint 

 

Best, Dave

Hi David,

Didn't want to purchase a app to do something that should be possible in PowerShell. Thanks for your reply.

Che
best response confirmed by CheWeigand (Contributor)
Solution
Hi!

You can't move it straight over but you can use PnP provsinioning to get a template of the site, and then you can apply it to a new site.

https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-...

Content must be moved manually thou :)

Hi Nicholas,

Thanks!
I have worked with PnP before, but it used a Subsite to my Template site. I will read this thoroughly and see if I can apply it to our needs.

Thanks again!
Che
How did it go for you guys? :)
Just got back to this project today. The PnPOnline in Powershell is great. Had to figure out that the -configuration param should refer to a json file, Plus I haven't figured out how to get my Hero webpart pictures from the template to the new site. Menu bar is okay but the site icon is lost.

Any help with the images in the hero webpart would be appreciated.
Thanks
Images from Hero webpart should be located in the site assets, so you can move those over
Same for site Icon, I usually move the items first then use the Invoke-sitetemplate command(or if you're using other commands) :)
Great! I'll try that out now.
Okay - before invoking the template, I changed the thumbnail and site icon, changed the navigation to horizontal and standard.
Still not seeing the hero pictures, although they are listed in Site Assets. Also the 'Theme' color has to be set by me - not being brought from the Template.
I'll keep looking at this - this is a great step forward - I would like less manual setting up, but it will keep our department SP sites similar (we will still allow a department to edit their site).

Thank for all your input. Much appreciated.
Che
Hi Nicolas,
Got everything working.
1. I create new SP site
2. I add Site logo and choose Theme color
3. I run PS script

I needed to reconfigure my JSON config file, once that was done and a new XML file created, the assignment of the template attributes was seamless. I noticed that it took some time for the pictures to appear, but that is not a problem.

Please let me know if you would like me to share the JSON or PS script file.
Thanks again for pointing me in the right direction!
Che
Great job!!

You should create a blogpost about this and other problems you faces, great way to keep track of it and if other people face the same problems.

You can also upload your script here if you want :)

https://pnp.github.io/script-samples/
Thanks, Nicolas!