Why File Share Migration Creates Duplicate Folders
🔍 WiseChecker

Why File Share Migration Creates Duplicate Folders

Duplicate folders appear in SharePoint after a file share migration when the migration tool copies folder contents into a new folder instead of merging them with the existing folder structure. This problem occurs most often when the source file share has subfolders with names that match folders already created in the target SharePoint library or when the migration tool runs multiple passes over the same data. This article explains the root causes of duplicate folder creation during file share migrations and provides steps to prevent and fix the issue.

Key Takeaways: Preventing Duplicate Folders in SharePoint Migrations

  • SharePoint Migration Tool > Settings > Preserve folder structure: Enabling this option forces the tool to map source folders to existing SharePoint folders instead of creating new ones.
  • Source file share folder name case sensitivity: SharePoint treats folder names as case-insensitive, but some migration tools treat them as case-sensitive, causing duplicates when the same name exists with different casing.
  • Migration tool incremental scan: Running multiple migration passes without enabling incremental merge causes the tool to re-create folders that already exist in the target.

ADVERTISEMENT

Why Duplicate Folders Appear During File Share Migration

File share migrations to SharePoint often use tools such as the SharePoint Migration Tool, ShareGate, or Metalogix. These tools copy files and folders from a network file share to a SharePoint document library. Duplicate folders occur when the migration tool does not correctly map the source folder path to the target folder path. The tool creates a new folder in SharePoint that contains the copied files instead of placing those files into an existing folder with a matching name.

The root cause is a mismatch between how the source file share organizes folders and how the target SharePoint library is structured. For example, if the source file share has a folder named “Finance Reports” and the target library already has a folder named “Finance Reports,” the migration tool might create a second folder named “Finance Reports 1” or place the copied files into a new folder with the same name under a different parent. This happens because the tool does not perform a folder merge by default.

Folder Name Case Sensitivity

Windows file shares are case-insensitive but case-preserving. SharePoint is also case-insensitive. However, some third-party migration tools treat folder names as case-sensitive during the mapping process. If the source folder is named “Marketing” and the target already has a folder named “marketing,” the tool might create a second folder named “Marketing” because it sees the names as different. This creates two folders with identical content in the same library.

Multiple Migration Passes Without Incremental Merge

Many migration tools support incremental migration, meaning they copy only new or changed files after the initial pass. If the tool does not use incremental merge, each pass creates a new folder structure in the target. For example, the first pass creates a folder named “Projects.” The second pass, run a day later to capture new files, might create a folder named “Projects 2025-03-21” instead of adding files to the existing “Projects” folder.

Steps to Prevent Duplicate Folders During Migration

Follow these steps to configure your migration tool and source structure to avoid duplicate folders.

  1. Scan the source file share for folder name conflicts
    Run a folder name inventory on the source file share. Use PowerShell to list all folder names and check for case variants. For example, run Get-ChildItem -Recurse -Directory | Group-Object { $_.Name.ToLower() } | Where-Object { $_.Count -gt 1 }. Rename any folders that differ only by case before starting the migration.
  2. Create the target folder structure in SharePoint first
    Manually create the top-level folders in the SharePoint document library that match the source file share structure. Use the SharePoint user interface or a script to create folders with exact names. This gives the migration tool a target to map into and reduces the chance of duplicate creation.
  3. Enable folder merge in the migration tool
    In the SharePoint Migration Tool, open Settings and select “Preserve folder structure” and “Merge folders with same name.” For ShareGate, select “Merge” under the destination folder options. For Metalogix, enable “Merge target folder with source.” This tells the tool to place files into existing folders instead of creating new ones.
  4. Use a single migration pass for the initial copy
    Schedule one full migration pass that copies all files and folders from the source to the target. Avoid running multiple passes for the same data set. If you need to copy additional files later, use the incremental migration feature with the merge option still enabled.
  5. Test the migration on a small subset first
    Select one folder from the source file share that contains subfolders. Run the migration to a test SharePoint site. Check the target library for duplicate folders. If duplicates appear, adjust the tool settings before running the full migration.

ADVERTISEMENT

If Duplicate Folders Still Appear After the Main Fix

Even with correct settings, some migration scenarios produce duplicate folders. Here are the common patterns and how to resolve them.

Duplicate Folder Created With a Timestamp Suffix

The migration tool adds a date or number suffix to a folder name when it detects a name conflict. For example, “Contracts” becomes “Contracts 2025-03-21.” This happens when the tool is set to create a new folder for each migration pass instead of merging. To fix this, delete the duplicate folder and run the migration again with the merge option enabled. If the duplicate contains files that were not in the original folder, move those files into the original folder before deleting the duplicate.

Folder Created Under a Different Parent Path

The migration tool places a folder into the root of the library instead of inside the correct parent folder. This occurs when the source path mapping is incorrect. For example, the source folder “\server\share\Finance\Reports” maps to the target library root, creating a “Reports” folder there instead of inside the existing “Finance” folder. To fix this, delete the misplaced folder and reconfigure the source-to-target path mapping. In the migration tool, specify the exact target folder path, such as “https://tenant.sharepoint.com/sites/site/Shared%20Documents/Finance.”

Folder Name Has Trailing Spaces or Special Characters

A folder name in the source file share might have a trailing space or a character that SharePoint does not support, such as an ampersand or a tilde. The migration tool might create a folder in SharePoint with the unsupported character removed or replaced, while also creating a second folder with the original name. To fix this, rename the source folder to remove trailing spaces and replace unsupported characters with hyphens or underscores before running the migration. SharePoint supported characters include letters, numbers, spaces, hyphens, underscores, periods, and parentheses.

Item SharePoint Migration Tool ShareGate Metalogix
Merge folders with same name Settings > Preserve folder structure + Merge folders Destination options > Merge Merge target folder with source
Case-sensitive folder detection Treats as case-insensitive Treats as case-insensitive Treats as case-sensitive (requires manual fix)
Incremental merge support Yes, when merge is enabled Yes, when merge is selected Yes, when merge is enabled
Folder name conflict handling Creates folder with suffix Creates folder with suffix Creates folder with suffix

Duplicate folders in SharePoint after a file share migration are avoidable. By scanning the source for naming conflicts, enabling folder merge in your migration tool, and using a single initial pass, you can keep your target library clean. If duplicates appear, check the folder path mapping and delete the extra folders after moving their contents. For ongoing migrations, always enable incremental merge to prevent new passes from creating separate folder structures.

ADVERTISEMENT