{"id":18195738,"url":"https://github.com/valencia-risk/sp-list-migration-scripts","last_synced_at":"2026-03-04T20:02:41.286Z","repository":{"id":260523295,"uuid":"881514674","full_name":"Valencia-Risk/SP-List-Migration-Scripts","owner":"Valencia-Risk","description":"PowerShell Scripts to Import/Export SharePoint Lists. Useful for cross tenant migrations.","archived":false,"fork":false,"pushed_at":"2024-11-05T18:19:10.000Z","size":15,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-28T20:42:06.688Z","etag":null,"topics":["automation","pnp","pnp-powershell","powershell","sharepoint","sharepoint-lists"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Valencia-Risk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-31T18:16:39.000Z","updated_at":"2024-12-30T22:30:50.000Z","dependencies_parsed_at":"2024-12-21T07:10:34.213Z","dependency_job_id":"1d13d298-1967-4eaf-b348-9c5b5336377f","html_url":"https://github.com/Valencia-Risk/SP-List-Migration-Scripts","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"bc7f936cbefd3299b041a2347cae9a243cd00b43"},"previous_names":["valencia-risk/sp-list-migration-scripts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Valencia-Risk/SP-List-Migration-Scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valencia-Risk%2FSP-List-Migration-Scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valencia-Risk%2FSP-List-Migration-Scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valencia-Risk%2FSP-List-Migration-Scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valencia-Risk%2FSP-List-Migration-Scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Valencia-Risk","download_url":"https://codeload.github.com/Valencia-Risk/SP-List-Migration-Scripts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Valencia-Risk%2FSP-List-Migration-Scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30091571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T19:41:02.502Z","status":"ssl_error","status_checked_at":"2026-03-04T19:40:05.550Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","pnp","pnp-powershell","powershell","sharepoint","sharepoint-lists"],"created_at":"2024-11-03T08:04:41.647Z","updated_at":"2026-03-04T20:02:41.252Z","avatar_url":"https://github.com/Valencia-Risk.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SharePoint List Migration Scripts\nSimple PowerShell Scripts to Import/Export Lists using PnP Provisioning's Site Templates. Useful for Tenant migrations.\nPnP Provisioning uses the modern SharePoint solution for templating, Site Templates, instead of the old SharePoint method of App Templates (.stp file).\n\nData can be optionally exported using the `IncludeData` export setting in `appsettings.json`.\n\n## Features\n\n- [x] Export an array of Lists and Data (optional) from **one** SharePoint Site.\n- [x] Import Lists and Data (if included) to **one** SharePoint Site on the same Tenant or another Tenant.\n\n### Needs Developing\n\n- [ ] Combined export-to-import automation for migrating lists.\n- [ ] Rename lists on import/export.\n\n## Important Note on Importing\n\n**TLDR:** Destination's existing rows will **not** be replaced or merged. New or missing rows **will** be added to an existing List.\n\nImported lists will be applied on top of any Lists on the destination that share the same name, but it will preserve rows that existed before based on Unique column requirements. For example, ID 23 exists on Destination already, but the template also includes ID 23. As ID is **unique**, the new (from template) row violates this rule and is dropped, not merged.\n\nHowever, any new rows that don't violate **unique** rules will be added to an existing List.\n\n## Configuration\n\n### Prerequisites\n\n* Ensure you have PowerShell version 7.4.0 or higher installed. You can check your current version by running the following command in your PowerShell terminal:\n  ```powershell\n  $PSVersionTable.PSVersion\n  ```\n  If your version is lower than 7.4.0, you will need to update PowerShell.\n\n* Install the PnP.PowerShell module if it is not already installed. You can do this by running the following command in your PowerShell terminal:\n  ```powershell\n  Install-Module PnP.PowerShell -Scope CurrentUser -Force\n  ```\n\nThese steps are necessary to ensure the scripts in this repository run correctly. `ExportList.ps1` will include checks for these as well.\n\n### Entra ID App Registration\n\nThis step is only required on one Tenant as we use a Multi-Tenant setup. Meaning if I'm doing a full migration, I can just set up the App Registration in tenant 1 and I'll be asked for approval/consent when I sign into tenant 2.\n\n*If you've been provided a Client ID from someone else, like Valencia Risk, skip the Entra ID App Registration and enter the provided ID into the appsettings.json.*\n\n* Set up a multi-tenant application in Entra ID.\n* Configure the following delegated API permissions for the application:\n  * `Graph - Sites.FullControl.All`\n  * `SharePoint - AllSites.FullControl`\n* Grant Admin Approval for all API permissions.\n* Ensure the `ClientId` in the `appsettings.json` file matches the application registration's client ID. See next section.\n* A client-secret is not needed as it's Multi-Tenant and uses Delegated permissions. Meaning we get the token and tenant via the User sign in.\n\nThese steps are necessary to ensure the application has the required permissions to access and manage SharePoint sites and lists.\n\n### Setting up appsettings.json\n\n1. Copy the `appsettings.template.json` file and rename it to `appsettings.json`.\n2. Open the `appsettings.json` file and update the values as needed.\n    - If you wish to only use one script, skip the other specific settings. E.g. You only want to Import, then don't fill out the ExportSettings.\n\n## Running the Scripts\n\nTo run the scripts, use the following command in your PowerShell terminal:\n\n### Export SharePoint Lists\nThe script will use the settings defined in the `appsettings.json` file. Therefore, ensure the correct **List Names** and **Source URL** are configured in `appsettings.json`.\n\n```powershell\n./ExportList.ps1\n```\n\n### Import SharePoint Lists\nThe script will use the settings defined in the `appsettings.json` file. Therefore, ensure the correct **Destination URL** and **ImportFilePath** are configured in `appsettings.json`.\n\nThis will use a PnP Template, either .xml or .pnp file types. Ensure the template exists at the location specified in `appsettings.json`.\n\n```powershell\n./ImportList.ps1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalencia-risk%2Fsp-list-migration-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalencia-risk%2Fsp-list-migration-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalencia-risk%2Fsp-list-migration-scripts/lists"}