Export and Import SharePoint Document & List Schema
On < 1 minuteUsing the new PnP provisioning engine, you can export the schema for an existing document library or list, then import it in a new environment.
Here is the code using SharePoint PnP powershell.
Connect-PnPOnline "https://yourtenant.sharepoint.com/sites/yoursite" -UseWebLogin
Export-PnPListToProvisioningTemplate -List "Documents" -Out template.xml
#connect to new environment or site
Apply-PnPProvisioningTemplate -Path template.xml
Update
These commands have been renamed to
Export-PnPListToSiteTemplate
Invoke-PnPSiteTemplate
Other posts you might be interested in
- Create Announcement List in a Communication Site
- Create Picture Library in a Communication Site
- Fix: Cannot connect SharePoint Designer to Modern Team sites
- Fix Connect-SPOService : Could not authenticate to SharePoint Online using OAuth 2.0
- How to Remove the Top Banner from SharePoint Online Modern Pages