# SharePoint migration connector
Migrates documents from a source SharePoint environment to SharePoint matter sites provisioned by Epona ProvisioningService.
DLL: Epona.Migrate.Sharepoint.dll
Audience
Technical consultants with SharePoint and Epona365 knowledge. Read the migration overview before starting.
# What it does
The SharePoint connector reads matters from a source SharePoint environment and copies their documents to the matching matter sites on a target SharePoint environment. It supports:
- Site-to-site transfer — copies documents, with versions and metadata, from the source matter's document libraries to the target matter's document library
- Folder mapping — keeps the source folder structure, moves it into a target subfolder, or renames folders with
ReplaceFolders - Content type mapping — converts source content types to target content types
- Permission migration — copies folder and document permissions, or exports them to Excel for review and import with the Permission Set file handler
- Delta migration — tracks migrated documents in the migration database; later runs only process new or changed documents
- Date filtering — migrates only documents created or modified after a given date
# Prerequisites
- The
Epona.Migrate.exebuild for the SharePoint version you migrate to: the SharePoint Online build for a SharePoint Online target, the SharePoint 2016 build for a SharePoint 2016 target. The source version does not decide the build. - A SharepointCfg for the source environment, with credentials that can read the source matter sites
- A SharepointCfg for the target environment, with credentials that can write to the target matter sites
- Target matter sites provisioned by Epona ProvisioningService. Each target matter must have one document library
- Content types used by
ReplaceContentTypesmust exist on the target document library - A migration database selected in the main window (tracks what was migrated)
# Deployment
- Copy
Epona.Migrate.Sharepoint.dllto theEpona.Migrate.exeapplication directory - Start
Epona.Migrate.exe— the Sharepoint tab appears automatically - Configure the source and target (see steps below)
# Step 1 — Select the source and the target
The connector uses two SharePoint environments:
| Role | Where it is selected |
|---|---|
| Source | SourceSharepointConfigName in the SharePoint migration configuration (Step 2) |
| Target | SharePoint Environment dropdown in the main window |
- In the Sharepoint tab, click the
...button next to the Configuration dropdown to open the configuration editor - Click Add and set
NameandSourceSharepointConfigName(the name of the SharepointCfg of the source environment) - Click Save, then select the configuration in the Configuration dropdown
- In the main window, select the target SharePoint environment and the migration database
The configuration is saved as Config\MigrateSharepoint\{Name}.json in the Epona.Migrate.exe directory.
TIP
Import requires the configuration, the target SharePoint environment and the migration database. Dump needs only the configuration, but uses the target and the database when they are selected — see Step 4.
# Step 2 — Configure settings
# Global
| Setting | Type | Default | Description |
|---|---|---|---|
Name | string | — | Required. Unique name of the configuration |
SourceSharepointConfigName | string | — | Required. Name of the SharepointCfg of the source environment |
Debug | bool | false | Enable verbose debug logging |
# Matter codes
| Setting | Type | Default | Description |
|---|---|---|---|
ClientMatterSeparator | char? | @ | Character that splits a client code from a matter code, for example ABC@001. Only needed when matter codes are not unique across clients (MatterCodeIsNotUnique in the SharepointCfg of the source or target), or with CombineClientAndMatterCodeToMatterCode. Applies to both the source and the target part of a matter code entry. |
CombineClientAndMatterCodeToMatterCode | string | — | If set, combines the target client code and matter code with this character to find the target matter (for example _ turns ABC@001 into ABC_001). |
# Migrate
| Setting | Type | Default | Description |
|---|---|---|---|
ImportEmptyFolder | bool | false | Create target folders for source folders without documents |
ImportFolderPermissions | bool | false | Copy the permissions of source folders and library roots to the target folders. See Permissions. |
ImportDocumentPermissions | bool | true | Copy unique document permissions to the target documents. Not applied when the target uses Azure Blob Storage — see Permissions. Read Avoid too many unique permissions before you leave this on. |
ImportOnlyLatestVersion | bool | false | Import only the latest version of each document |
ImportDocumentMinimalDateTime | DateTime? | — | Only import documents created (or modified) after this date |
ImportDocumentMinimalDateTimeUseModifyDate | bool | false | Use the modified date instead of the created date for ImportDocumentMinimalDateTime |
UseSearchToFetchFolders | bool | false | SharePoint Online sources only: use search to list the folders. May work better for large libraries. |
ReplaceContentTypes | string | Document=DMS Document | Maps source content types to target content types. Format: source=target; |
ReplaceFolders | string | — | Renames or skips folders. See Folder path mapping for the syntax. |
# Metadata
| Setting | Description |
|---|---|
DocumentNumber | Target column for the source document number (without version) |
DocumentNumberVersion | Target column for the source document number with version |
DocumentVersion | Target column for the source version number |
FieldMapping | Which source columns are copied, and to which target column. See Column and value mapping. |
FieldValueMapping | Replaces source values with target values, per column. See Column and value mapping. |
# Column and value mapping
The connector copies the metadata of every source document: all columns of the source library that are not hidden and not read-only. Columns are matched by internal name.
FieldMapping decides, per source column, where its value goes. One entry per line, or separated by ;.
| Entry | Effect |
|---|---|
| (column not listed) | Copied to the target column with the same internal name |
Status=DocStatus | Copied to target column DocStatus |
Status= | Not copied (empty target) |
=Remarks | Every column that is not listed writes to Remarks. Values are not merged: each one overwrites the previous, so Remarks ends up with the value of one random column. Do not use. |
The default, ClientCode=;ClientName=;MatterCode=;MatterName=;, skips the client and matter columns. The target matter site already sets them, and the source values belong to the source matter. Add ContentType=<column> to also write the source content type name to a text column.
Make sure every copied column exists on the target library, or skip it with Column=.
FieldValueMapping replaces text values of one column. Add an entry per column:
| Property | Description |
|---|---|
Name | Internal name of the source column |
FieldMapping | Value pairs, one per line or separated by ;: sourceValue=targetValue |
Example: Name = Status, FieldMapping = Concept=Draft;Definitief=Final.
Values without a pair go through SettingsCfg.DynamicFieldValueMapping of the target SharepointCfg, scoped with the SPMigration. prefix (for example SPMigration.Status). That setting also supports wildcards and an unknown-value fallback; see Dynamic Name → DynamicFieldValueMapping. Values that match neither are copied unchanged.
# Step 3 — Map matters and folders
Enter the matters to migrate in the MatterCode(s) / DocUrl=MatterCode text box, one per line or separated by ;. Each entry is a source and an optional target, separated by =.
| Entry | Source | Target |
|---|---|---|
001 | Matter 001 | The same matter |
001=900 | Matter 001 | Matter 900 |
001=900/Archive | Matter 001 | Folder Archive in matter 900 |
When matter codes are not unique across clients, add the client code with ClientMatterSeparator:
| Entry | Source | Target |
|---|---|---|
ABC@001 | Matter 001 of client ABC | The same client and matter |
ABC@001=XYZ@900 | Matter 001 of client ABC | Matter 900 of client XYZ |
ABC@001=XYZ@900/Archive | Matter 001 of client ABC | Folder Archive in matter 900 of client XYZ |
How the matter is found, in the source and in the target environment separately:
| Situation | Result |
|---|---|
MatterCodeIsNotUnique is off in the SharepointCfg | The client code is ignored; the matter is found by matter code only |
No client code in the entry (001) | Found by matter code only. With more than one hit, the matter fails with Multiple items found in field … in list Matters |
| The client code does not exist in the client list | Same as no client code: found by matter code only, when that is unique |
| The client exists, but the matter does not belong to it | Not found. There is no fallback to the matter code only; the matter fails with Imported Matter or Doclib not found (target) or Exported Matter or Doclib not found (source) |
When Url is checked, the source is a URL instead of a matter code. The URL can point to a site, a document library or a folder:
| Entry | Source | Target |
|---|---|---|
https://source.sharepoint.com/sites/abc001/Documents/Contracts=900 | Folder Contracts | Library root of matter 900 |
https://source.sharepoint.com/sites/abc001/Documents/Contracts=900/Contracts | Folder Contracts | Folder Contracts in matter 900 |
# Where the folders land
All content of a matter lands in the first document library of the target matter:
- One source library — the folder structure is kept:
Folder/Subin the source becomesFolder/Subin the target library. - Several source libraries (and Url not checked) — each source library gets its own folder, named after the library:
Folder/Subin libraryEmailsbecomesEmails/Folder/Sub. Files in the root of libraryEmailsgo to the folderEmails. - Target folder (
=900/Archive) — everything is placed under that folder:Archive/Folder/Sub. ReplaceFolders— applied last, to the mapped path. See Folder path mapping.
The Folders sheet of the Dump shows the mapped path of every folder in the NewTargetFolder column. Check it before you import.
# Step 4 — Dump (explore content and permissions)
Click Dump to read the source matters and write an overview Excel file. No documents are migrated. The file is saved to the Migrate\ subdirectory as SharepointDump_{SourceConfig}_{timestamp}.xlsx.
Select the target SharePoint environment and the migration database in the main window before you run the Dump. The Dump then uses:
- the target to find the document library of each target matter, so permission rows point to the right library
- the migration database to count migrated files per folder and to find where each document was actually stored
| Sheet | Contents | Typical use |
|---|---|---|
| Folders | Every source folder with its file count, migrated count, error count and mapped target folder (NewTargetFolder) | Check the folder mapping and track progress per folder |
| Users | Users of the source environment and the source matter sites | Build the ReplaceUserGroupNames mapping (see Map users and groups) |
| Security | Unique permissions of the source sites, library roots and folders | Apply site or folder permissions with the Permission Set file handler |
| DocumentSecurity | Unique permissions of source documents | Apply document permissions with the Permission Set file handler |
| Shared | Sites, libraries, folders and documents that have sharing links on the source | Review; share again by hand on the target where needed (see Sharing links). Never drop this sheet into the Permission Set file handler. |
The Security and DocumentSecurity sheets contain only permissions that can be applied on the target. The Dump leaves out:
- Limited access (Limited Access and Web-Only Limited Access roles, including the Limited Access System Group members). SharePoint grants these itself on the parents of an item with its own permissions, in any language. The SharePoint 2016 build of the Migrate tool leaves out only Limited Access: delete Web-Only Limited Access columns by hand before you apply the sheets.
- Sharing links (
SharingLinks.…groups). They are listed on the Shared sheet instead.
A row with no members left is not written.
# Security and DocumentSecurity columns
Both permission sheets use the column names of the Permission Set file handler. Columns that start with __ are information only; the file handler ignores them.
| Column | Description |
|---|---|
__SourceClientCode, __SourceMatterCode | Source matter |
__SourceObjectType | Security only: Site, DocLib (library root) or Folder |
__SourceUrl | Source site or document library |
__SourceFolder | Source folder. The roles of the row are read from this folder. |
__SourceDocument | DocumentSecurity only: source file name |
__TargetResolvedBy | How ObjectUrl was determined (see below) |
ClientCode, MatterCode | Target matter. The file handler applies the row to this matter's site. |
Folder | Security only: mapped target folder, for reference |
ObjectUrl | Target object, relative to the target matter site: Library/Folder or Library/Folder/File.ext. Empty for a site row. |
DisableInheritance, RemovePermissions | Always true: the target gets exactly the source roles |
Groups.<Role>, DomainMembers.<Role> | Members per role, as on the source |
__TargetResolvedBy values:
| Value | Meaning |
|---|---|
Site | The row applies to the target matter site |
Database | The document was migrated; ObjectUrl is its location as recorded in the migration database. This is the most reliable value: it includes renames and documents routed to the AutoFiling folder. |
Mapping | ObjectUrl was built from the folder mapping and the target matter's document library |
Mapping (source library) | As Mapping, but the target matter was not found (or no target was selected), so the library name of the source was used. Check these rows: the library name can differ on the target. |
Library root rows (DocLib) point to the place where the root of the source library landed: the target library itself with one source library, or the library folder (for example Documents/Emails) with several source libraries or a target folder. They never change the permissions of the whole target library in those cases.
Url entries with several source libraries
When Url is checked, the libraries of a source site with several libraries do not get their own folder. All their DocLib rows then point to the same place (the target library, or the target folder), and each row replaces the permissions of the previous one. Keep at most one of these DocLib rows, or delete them all.
Document rows are written only for documents with unique permissions. Documents that inherit from their folder get no row.
# Step 5 — Import
Read before importing
Read Avoid too many unique permissions before the first import. Without Azure Blob Storage, ImportDocumentPermissions (default true) gives every source document with unique permissions its own permissions on the target, with no review step. Run Dump first and check the number of rows on the DocumentSecurity sheet. When there are many, turn ImportDocumentPermissions off and apply a reviewed DocumentSecurity sheet after the import instead.
- Select the configuration, the target SharePoint environment and the migration database
- Enter the matters (see Step 3); check Url if the entries are URLs
- Click Import and confirm
For each matter, the connector:
- Finds the source matter (or URL) and the target matter. The import of a matter fails when the target matter is not found or has more than one document library.
- Walks every folder of every source library and maps it to a target folder (see Where the folders land)
- Creates the target folder, with the source folder's permissions when
ImportFolderPermissionsis on - Uploads each document with its versions and metadata, and records it in the migration database. Documents already migrated without error are skipped.
Report writes a migration report from the migration database.
Azure Blob Storage
When UseAzureBlobStorage is enabled in the target SharepointCfg, the import only queues the uploads, and the Monitor migrations window opens. Document permissions are not imported. See Azure migration jobs and monitor and Document permissions with Azure Blob Storage.
# Step 6 — Permissions
What the import applies:
| Permission | Applied by the import when | Source |
|---|---|---|
| Folder | ImportFolderPermissions is on and the import creates the folder | The source folder's unique permissions, applied to the mapped target folder |
| Library root, several source libraries or a target folder | ImportFolderPermissions is on and the import creates the library folder (for example Documents/Emails) | The source library's permissions |
| Library root, one source library | Never | The target library already exists. Use the DocLib row of the Security sheet. |
| Document | ImportDocumentPermissions is on and Azure Blob Storage is off | The document's unique permissions |
| Site | Never | The target site keeps its provisioned permissions. Use the Site row of the Security sheet. |
Folder permissions are added to the folder after inheritance is broken. The import does not remove existing permissions. A folder that already exists on the target — created by provisioning or by an earlier import run — keeps its permissions; running the import again does not change them.
SharePoint 2010 sources
Folder permissions cannot be read from a SharePoint 2010 source. Turn ImportFolderPermissions off; otherwise the import of every subfolder fails.
# Document permissions with Azure Blob Storage
With Azure Blob Storage the import applies the permissions of the folders it creates (when ImportFolderPermissions is on), but not document permissions. Apply them afterwards from the Dump:
- Run the import.
- Wait until Monitor migrations shows that every queued migration of the matters has finished. A Dump made earlier points to files that do not exist yet.
- Run Dump with the same matters, the same migration database and the target SharePoint environment selected.
- Review the DocumentSecurity sheet:
- Check the rows marked
Mapping (source library)first. - Reduce the number of unique permissions — see Avoid too many unique permissions.
- Check the rows marked
- Copy the DocumentSecurity sheet to a new workbook, as its only sheet. Save it with
permissionsetin the file name, for example20260101 permissionset documents.xlsx. - Drop the file into the ProvisioningService. The Permission Set file handler applies each row.
One sheet per file
The file handler reads only the sheet that is active when the file is opened. The Dump file opens on the Folders sheet, so dropping the Dump file as it is applies nothing useful. Always put a permission sheet in its own file.
# When the Security sheet is still needed
With ImportFolderPermissions on, the import has already applied the permissions of the folders it created. Use the Security sheet (alone in its own permissionset file, before the DocumentSecurity file) for what the import did not apply. Keep only the rows you need:
- All
FolderandDocLibrows whenImportFolderPermissionswas off during the import. - The
DocLibrow of a matter with one source library: the import never changes the permissions of the target library. With Url entries and several source libraries, see Url entries with several source libraries. Folderrows of folders that already existed on the target before the import: provisioned folders, or folders from an earlier import run.- The
Siterow, only when the target site must get the source site's permissions. The import never sets them.
A DocLib or Folder row reports Web / List / Folder / File not found when the import did not create that folder (for example a library root without files, with ImportEmptyFolder off). Nothing is changed for that row; this is harmless.
# Avoid too many unique permissions
Each DocumentSecurity row breaks the permission inheritance of one file. Every file with its own permissions is one unique permission scope in its library.
- SharePoint supports at most 50,000 unique permission scopes per library; Microsoft recommends no more than 5,000 (SharePoint limits (opens new window)).
- Above the list view threshold, unique scopes make SharePoint slower: every view of the library needs extra database work. Microsoft recommends fewer than 5,000 unique scopes per library when migrating (Migration permission guidance (opens new window)).
Before applying the DocumentSecurity file, reduce it:
- Delete rows that add nothing. Compare each row with the Security row of the same
__SourceFolder. When that folder has no row, it inherits: compare with the row of the nearest parent folder, theDocLibrow, or theSiterow. If the roles are the same, the row adds a unique scope without changing who has access. Delete it — but only when the target folder gets those roles too (ImportFolderPermissionswas on, or you apply the Security sheet). Otherwise the document inherits the target library's permissions. - Convert to folder permissions. When many documents in one folder share the same roles, give them one folder permission instead of one row per document: put the documents in a folder on the target, add a Security row for that folder with those roles, and delete their DocumentSecurity rows.
- Check shared documents first. Sharing a document in SharePoint breaks its inheritance and copies the folder's roles. A document on the Shared sheet therefore often has a DocumentSecurity row with exactly its folder's roles. Without the sharing link, that row adds nothing: delete it.
# Sharing links
Sharing links are not migrated. A link belongs to the source object and its URL only works on the source; people who received the link cannot use it on the target.
The Shared sheet lists every object with at least one sharing link:
| Column | Description |
|---|---|
__SourceClientCode, __SourceMatterCode | Source matter |
ObjectType | Site, DocLib, Folder or Document |
SourceUrl, SourceFolder, SourceDocument | Source location |
ClientCode, MatterCode, ObjectUrl | Target matter and object, the same as on the permission sheets |
SharingLinks | Link type and role per link, for example OrganizationEdit (Contributor) (people in the organization with the link can edit) |
InPermissionSheet | True: the object is also on Security or DocumentSecurity with its other members. False: the object only had sharing links, so it has no permission row and inherits on the target. |
Review the list with the customer. Where people still need the shared access, share the object again on the target and send the new link.
# Map users and groups
Source user and group names often do not exist on the target. Map them with ReplaceUserGroupNames (Replace User/Group names) in the SettingsCfg of the target SharepointCfg — the one the ProvisioningService uses when it applies the permission files:
SOURCE\jdoe=jdoe@contoso.com
Source Matter Members=Matter Members
=permissions-fallback@contoso.com
- One mapping per line, or separated by
;. Format:sourceName=targetName. - Applies to user and group names in
DomainMembers.<Role>andGroups.<Role>columns. - A mapping with an empty source name (
=name) is used for every user or group that is not found on the target. - Use the Users sheet of the Dump to find the source names.
# Troubleshooting
# "Select an import configuration, database and/or sharepoint configuration before importing"
- Cause: The configuration, the SharePoint environment or the migration database is not selected
- Resolution: Select all three before clicking Import
# "SourceSharepointConfigName is not set"
- Cause: The configuration has no source SharePoint environment
- Resolution: Set
SourceSharepointConfigNameto the name of the source SharepointCfg
# "Imported Matter or Doclib not found"
- Cause: The target matter does not exist, or the target part of the entry is wrong
- Resolution: Check the target matter code in the Folders sheet (
NewClientCode,NewMatterCode) and checkClientMatterSeparatorandCombineClientAndMatterCodeToMatterCode
# "Multiple targetdoclibs not supported yet"
- Cause: The target matter has more than one document library
- Resolution: Migrate to a matter with one document library
# Permission rows fail with "Web / List / Folder / File not found"
- Cause: The object in
ObjectUrldoes not exist on the target. For a document row: the document was not migrated yet (Azure Blob still running), or__TargetResolvedByisMapping (source library)with a library name that differs on the target. - Resolution: Wait until Monitor migrations shows all migrations finished, then run the Dump again with the migration database and the target selected.
# Permissions not transferred
- Cause:
ImportFolderPermissionsorImportDocumentPermissionsis off, the target uses Azure Blob Storage (document permissions), or users and groups do not exist on the target - Resolution: Enable the setting, follow Document permissions with Azure Blob Storage, and map names with
ReplaceUserGroupNames
# Content type not found
- Cause: A target content type in
ReplaceContentTypesdoes not exist on the target document library - Resolution: Add the content type to the target document library before the import
# Related
- Migration overview — how document migration works
- Azure migration jobs and monitor — job lifecycle and monitor window when
UseAzureBlobStorageis enabled - Folder path mapping —
ReplaceFolderssyntax and examples - Permission Set file handler — applies the Security and DocumentSecurity sheets