PnP Export Modern pages with GetProvisioningTemplate

%3CLINGO-SUB%20id%3D%22lingo-sub-154295%22%20slang%3D%22en-US%22%3EPnP%20Export%20Modern%20pages%20with%20GetProvisioningTemplate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-154295%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI'm%20currently%26nbsp%3Bworking%20the%20provisioning%20part%20of%20PnP.%20I%20created%20a%20template%20subsite%26nbsp%3Bwhich%20I%20would%20like%20to%20use%20to%20provision%20a%20new%20subsite.%20I%20create%20a%20provisioning%20template%20with%20the%20GetProvisioningTemplate%20method%20on%20a%20Web%20object.%20It%20creates%20the%20xml%20but%20it%20doesn't%20include%20any%20pages.%3C%2FP%3E%0A%3CP%3EI%20tried%20using%20the%26nbsp%3BProvisioningTemplateCreationInformation%20HandlersToProcess%20and%20included%20the%20pages%20and%20page%20content.%20But%20I%20only%20get%20my%20home.aspx%20as%20a%20ClientSidePage%20in%20the%20xml.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20applying%20the%20xml%20to%20the%20new%20subweb%20I%20get%26nbsp%3Bthe%20following%20error%3A%26nbsp%3B%3CSPAN%20class%3D%22pl-s%22%3EPage%20%3C%2FSPAN%3E%3CSPAN%3EHome.aspx%3C%2FSPAN%3E%3CSPAN%20class%3D%22pl-s%22%3E%26nbsp%3Bis%20not%20a%20%5C%3C%2FSPAN%3E%3CSPAN%20class%3D%22pl-pds%22%3E%22%3C%2FSPAN%3E%3CSPAN%3Emodern%5C%3C%2FSPAN%3E%3CSPAN%20class%3D%22pl-s%22%3E%3CSPAN%20class%3D%22pl-pds%22%3E%22%3C%2FSPAN%3E%20client%20side%20page.%20I%20get%20this%20because%20it%20need%20a%20property%20ClientSideApplicationId%20which%20isn't%20exported.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22pl-s%22%3EIs%20there%20any%20way%20to%20export%20the%20pages%20and%20include%20them%20in%20my%20template%3F%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22pl-s%22%3EThanks%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22pl-s%22%3ESen%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-159869%22%20slang%3D%22en-US%22%3ERe%3A%20PnP%20Export%20Modern%20pages%20with%20GetProvisioningTemplate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-159869%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F117222%22%20target%3D%22_blank%22%3E%40Sen%20Verleysen%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECheck%20out%20%3CA%20href%3D%22http%3A%2F%2Fsharepoint.handsontek.net%2F2018%2F02%2F04%2Fcreate-a-modern-sharepoint-site-template-with-multiple-pages-using-the-pnp-provisioning-engine%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ethis%3C%2FA%3E%20blog%20post%20by%20Joao%20Ferreira%20on%20how%20to%26nbsp%3Bexport%26nbsp%3Ball%20pages%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHope%20it%20helps%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EJoel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-154993%22%20slang%3D%22en-US%22%3ERe%3A%20PnP%20Export%20Modern%20pages%20with%20GetProvisioningTemplate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-154993%22%20slang%3D%22en-US%22%3E%3CP%3EEven%20on%20the%20welcome%20page%20I%20get%20an%20exception.%20Is%20there%20any%20way%20to%20set%20the%26nbsp%3B%3CSPAN%3EClientSideApplicationId%26nbsp%3Bproperty%20to%20resolve%20this%20error%3F%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWhats%20the%20best%20way%20to%20export%20the%20other%20pages%20(client%20side%20pages%20and%20wiki%20pages)%20and%20include%20them%20in%20the%20xml%3F%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-154572%22%20slang%3D%22en-US%22%3ERe%3A%20PnP%20Export%20Modern%20pages%20with%20GetProvisioningTemplate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-154572%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20will%20only%20include%20welcome%20page%20of%20web.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20other%20pages%2C%20you%20need%20to%20manually%20add%20in%20xml%20file%20before%20apply.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hi,

 

I'm currently working the provisioning part of PnP. I created a template subsite which I would like to use to provision a new subsite. I create a provisioning template with the GetProvisioningTemplate method on a Web object. It creates the xml but it doesn't include any pages.

I tried using the ProvisioningTemplateCreationInformation HandlersToProcess and included the pages and page content. But I only get my home.aspx as a ClientSidePage in the xml.

 

When applying the xml to the new subweb I get the following error: Page Home.aspx is not a \"modern\" client side page. I get this because it need a property ClientSideApplicationId which isn't exported.

 

Is there any way to export the pages and include them in my template?

 

Thanks

Sen

 

3 Replies
Highlighted

It will only include welcome page of web. 

For other pages, you need to manually add in xml file before apply.

Highlighted

Even on the welcome page I get an exception. Is there any way to set the ClientSideApplicationId property to resolve this error?

 

Whats the best way to export the other pages (client side pages and wiki pages) and include them in the xml?

 

Highlighted

Hi @Sen Verleysen,

 

Check out this blog post by Joao Ferreira on how to export all pages 

Hope it helps

 

Joel