pnp / PnP-Sites-Core

Microsoft 365 Dev PnP Core component (.NET) targeted for increasing developer productivity with CSOM based solutions.
Other
417 stars 644 forks source link

Get-PnPProvisioningTemplate is not downloading SiteAssets files #1296

Open kannan-balasubramanian opened 6 years ago

kannan-balasubramanian commented 6 years ago

Category

[x] Bug [ ] Enhancement

Environment

[x] Office 365 / SharePoint Online [ ] SharePoint 2016 [ ] SharePoint 2013

Note: I believe this is an issue with the PNP-Sites-Core rather then PNP-PowerShell.

Site Setup:

  1. New sub-site with "Team Sites" template within a site collection in SharePoint Online which is the source site for template (source-sub-site).
  2. "SiteAssets" folder has couple of HTML files with HTML content.
  3. Home Page has "Content Editor" web-part with source URL pointing to HTML files within "SiteAssets".
  4. Another new sub-site with "Team Sites" template within the same site collection in SharePoint Online which is the destination site for applying the template (target-sub-site).

Issue:

  1. I export the "source-sub-site" as template using Get-PnPProvisioningTemplate.
  2. Then apply that template using Apply-PnPProvisioningTemplate to new "target-sub-site" in the same site collection.
  3. Home page get's created in the "target-sub-site" but the web-part says "Cannot retrieve the URL specified in the Content Link property. For more assistance, contact your site administrator.".
  4. Have tried with "PersistBrandingFiles" or "PersistPublishingFiles".

Expected Behavior

When using Get-PnPProvisioningTemplate using XML based template file, I expect the "SiteAssets" files to get downloaded to the folder where the power shell script is being executed.

Observed Behavior

The template xml file get's created with web-part and it's references URL within the XML file. But the files within "SiteAssets" are not getting downloaded.

Same is the case if I use pnp file, the file doesn't have any "SiteAssets" artifacts.

Code: Connect-PnPOnline -Url $sourceSiteUrl -RequestTimeout 30000 Get-PnPProvisioningTemplate -Out SourceTemplate.xml -Force Connect-PnPOnline -Url $newSiteURL -RequestTimeout 30000 Apply-PnPProvisioningTemplate -Path SourceTemplate.xml

PS; Unfortunately I cannot share the template file as it has confidential URLs.

omerzubair commented 6 years ago
kannan-balasubramanian commented 6 years ago

Guys, can some one please look into this issue.

will101 commented 6 years ago

Hi, did you ever get a response or find a workaround for this? We have the same problem - so are now looking at manually editing the templates. Thanks :)

pluckey commented 6 years ago

This is still broken. It's pulling spcolor and spfont files, but it does not pull down any other files (ex: master pges). Thus apply-pnpprovisioningtemplate fails when it cannot find any of these files.

will101 commented 6 years ago

I did some reading around - and apparently it's not meant to get those items. In my experience, it only gets the home.aspx page, it doesnt get anything in the site assetts folder. Theres also a problem with sharepoint online at the moment that is messing up app provisioning

pluckey commented 6 years ago

Can you share any links, Will? get-pnpprovisioningtemplate makes references to files that it doesn't pull down, and breaks when it can't find them. This makes me think it should be pulling those files.

mores commented 6 years ago

Should an entry be added to https://office365.uservoice.com/ with a link to this issue ? If so we could all vote for this specific issue.....not sure if that would help or not.