Forum Discussion
Numberone1
Aug 16, 2021Copper Contributor
Sharepoint List
Hi everyone. So here I have a starting tenant with a starting Sharepoint list. Now I want to integrate it into an arrival tenant with an arrival Sharepoint list. How to do this using powershell?
- Aug 17, 2021
For list data migration, you can use Microsoft supported SharePoint Migration Tool (SPMT) or 3rd party tool like ShareGate Desktop.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
AdamWoj
Sep 26, 2021Iron Contributor
I know this already has best answer but the initial question was to use powershell and, at least I think so, to move List with data from Tenant A to Tenant B. If this is something that simple we could do it using following commands in PnP Powershell:
# step 1. connect to some site where is the list on tenant A
Connect-PnPOnline -Url "https://SiteUrlFromTenantA"
# step 2. get list template
Get-PnPSiteTemplate -Out "C:\TempDemo.xml" -ListsToExtract "testList" -Handlers Lists -Force
# step 3. populate list template with data
Add-PnPDataRowsToSiteTemplate -Path "C:\TempDemo.xml" -List "testList"
# step 4. disconnect from tenant A
Disconnect-PnPOnline
# step 5. connect to some site where is the list on tenant B
Connect-PnPOnline -Url "https://SiteUrlFromTenantB"
# step 6. apply the list template with data
Invoke-PnPSiteTemplate -Path "C:\TempDemo.xml"
I hope this will be of any help 🙂