Change a Modern SharePoint subsite to its own site


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:


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


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.


12 Replies

Hello @CheWeigand


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


Best, Dave

Hi David,

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

best response confirmed by CheWeigand (Contributor)

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.

Content must be moved manually thou :)

Hi Nicholas,

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!
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.
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.
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!
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 :)
Thanks, Nicolas!