SOLVED

Sharepoint online - copying List

%3CLINGO-SUB%20id%3D%22lingo-sub-840895%22%20slang%3D%22en-US%22%3ESharepoint%20online%20-%20copying%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-840895%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20am%20new%20to%20Sharepoint%2C%20created%20a%20sharepoint%20list%20which%20i%20am%20using%20for%20Powerapps%2C%20is%20there%20a%20way%20i%20can%20create%20a%20copy%20of%20this%20list%2C%20some%20thing%20like%20save%20as%3F%3C%2FP%3E%3CP%3EAlso%2C%20how%20do%20i%20export%20the%20list%20schema%20from%20one%20site%20to%20another%2C%20ex%3A%20dev%20to%20test%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3EJeevan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-840895%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-841045%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20online%20-%20copying%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-841045%22%20slang%3D%22en-US%22%3EIf%20you%20mean%20to%20copy%20with%20the%20content%2C%20there%20is%20not%20way%20if%20you%20are%20thinking%20on%20creating%20exactly%20the%20same%20list%20with%20the%20data%20stored%20in%20other%20sites.%20What%20you%20can%20do%20is%20%22export%22%20list%20definition%20to%20a%20PnP%20Template%20or%20to%20a%20Site%20Script%20so%20you%20can%20re-use%20when%20you%20need...and%20to%20export%20the%20contents%20and%20import%20to%20another%20list%20write%20a%20PS%20script%20%2F%20piece%20of%20code%20that%20allow%20you%20to%20do%20it%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-841076%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20online%20-%20copying%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-841076%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%2F60%22%20target%3D%22_blank%22%3E%40Juan%20Carlos%20Gonz%C3%A1lez%20Mart%C3%ADn%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EI%20don't%20need%20the%20data%20from%20that%20list%2C%20basically%20%2C%20i%20am%20using%20the%20list%20as%20Data%20source%20for%20my%20Canvas%20based%20powerapps%2C%20so%20the%20list%20is%20in%20Dev%20environment%2C%20now%20i%20need%20to%20move%20that%20list%20definition%20to%20another%20site(Test%2FProd)%2C%20so%20users%20can%20test%20my%20power%20app.%20what%20are%20my%20options%3F%3C%2FP%3E%3CP%3EI%20have%20got%20below%20documentation%20from%20MS%2C%20which%20command%20do%20i%20need%20to%20use%20to%20export%20the%20definition%20so%20i%20can%20reuse.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fsharepoint%2Fsharepoint-pnp%2Fsharepoint-pnp-cmdlets%3Fview%3Dsharepoint-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fsharepoint%2Fsharepoint-pnp%2Fsharepoint-pnp-cmdlets%3Fview%3Dsharepoint-ps%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-842099%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20online%20-%20copying%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-842099%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%2F404708%22%20target%3D%22_blank%22%3E%40jk264%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20SharePoint%2C%20you%20can%20save%20a%20list%20as%20template%20and%20create%20a%20new%20list%20from%20that%20template.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20find%20more%20details%20%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Fmanage-list-templates-c3884ad1-bc49-44b8-b3d6-3bc6a01eb393%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ehere%20-%26nbsp%3BManage%20list%20templates%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-842138%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20online%20-%20copying%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-842138%22%20slang%3D%22en-US%22%3EThat%20way%20of%20saving%20list%20templates%20(lest's%20call%20it%20%22classic%22)%20should%20be%20avoided%20and%20use%20PnP%20and%20Site%20Scripts%20instead.%20The%20command%20you%20need%20to%20make%20an%20export%20of%20you%20list%20is%20the%20following%20one%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fsharepoint-pnp%2Fget-pnpprovisioningtemplate%3Fview%3Dsharepoint-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fsharepoint-pnp%2Fget-pnpprovisioningtemplate%3Fview%3Dsharepoint-ps%3C%2FA%3E%3CBR%20%2F%3ETo%20do%20the%20same%20with%20site%20scripts%20take%20a%20look%20at%20the%20following%20article...there%20you%20will%20find%20how%20to%20extrat%20the%20site%20script%20from%20a%20list%20and%20create%20a%20site%20design%20based%20on%20that%20site%20script%3A%20%3CA%20href%3D%22https%3A%2F%2Fdrewmadelung.com%2Fpowershell-for-sharepoint-site-designs-site-scripts%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdrewmadelung.com%2Fpowershell-for-sharepoint-site-designs-site-scripts%2F%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-842145%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20online%20-%20copying%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-842145%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%2F60%22%20target%3D%22_blank%22%3E%40Juan%20Carlos%20Gonz%C3%A1lez%20Mart%C3%ADn%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20I%20ask%20why%20it%20should%20be%20avoided%3F%20What's%20the%20disadvantages%20of%20saving%20list%20templates%3F%20And%20the%20benefits%20of%20using%20PnP%20and%20Site%20Scripts%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-842146%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20online%20-%20copying%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-842146%22%20slang%3D%22en-US%22%3ESure%3A%3CBR%20%2F%3E(1)%20Saving%20a%20list%20as%20template%20using%20the%20classic%20approach%20generates%20a%20STP%20file...the%20approach%20can%20be%20valid%2C%20but%20it's%20not%20recommended%20by%20Microsoft.%20Consider%20it%20as%20a%20deprecated%20feature%3CBR%20%2F%3E(2)%20PnP%20%2B%20Site%20Scripts%20is%20the%20recommended%20way%20(by%20Microsoft)%20to%20go%20to%20extend%20a%20SPO%20Site%20with%20new%20Columns%2C%20Content%20Types%2C%20Lists%20and%20Document%20Libraries%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-842147%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20online%20-%20copying%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-842147%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F60%22%20target%3D%22_blank%22%3E%40Juan%20Carlos%20Gonz%C3%A1lez%20Mart%C3%ADn%3C%2FA%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20really%20helpful.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-846656%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20online%20-%20copying%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-846656%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F60%22%20target%3D%22_blank%22%3E%40Juan%20Carlos%20Gonz%C3%A1lez%20Mart%C3%ADn%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi,

I am new to Sharepoint, created a sharepoint list which i am using for Powerapps, is there a way i can create a copy of this list, some thing like save as?

Also, how do i export the list schema from one site to another, ex: dev to test?

 

Thanks

Jeevan

8 Replies
If you mean to copy with the content, there is not way if you are thinking on creating exactly the same list with the data stored in other sites. What you can do is "export" list definition to a PnP Template or to a Site Script so you can re-use when you need...and to export the contents and import to another list write a PS script / piece of code that allow you to do it

Hi @Juan Carlos González Martín ,

I don't need the data from that list, basically , i am using the list as Data source for my Canvas based powerapps, so the list is in Dev environment, now i need to move that list definition to another site(Test/Prod), so users can test my power app. what are my options?

I have got below documentation from MS, which command do i need to use to export the definition so i can reuse.

https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-pnp/sharepoint-pnp-cmdlets?view=sh... 

Hi @jk264 

 

In SharePoint, you can save a list as template and create a new list from that template.

 

You can find more details here - Manage list templates

 

 

 

Best Response confirmed by jk264 (New Contributor)
Solution
That way of saving list templates (lest's call it "classic") should be avoided and use PnP and Site Scripts instead. The command you need to make an export of you list is the following one: https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/get-pnpprovisioningtemplate?view=s...
To do the same with site scripts take a look at the following article...there you will find how to extrat the site script from a list and create a site design based on that site script: https://drewmadelung.com/powershell-for-sharepoint-site-designs-site-scripts/

Hi @Juan Carlos González Martín 

 

Can I ask why it should be avoided? What's the disadvantages of saving list templates? And the benefits of using PnP and Site Scripts?

 

 

Sure:
(1) Saving a list as template using the classic approach generates a STP file...the approach can be valid, but it's not recommended by Microsoft. Consider it as a deprecated feature
(2) PnP + Site Scripts is the recommended way (by Microsoft) to go to extend a SPO Site with new Columns, Content Types, Lists and Document Libraries

Thanks @Juan Carlos González Martín.

 

It's really helpful.