Why OneDrive Symlinks Break After a Profile Migration on Windows 11
🔍 WiseChecker

Why OneDrive Symlinks Break After a Profile Migration on Windows 11

Quick fix: OneDrive symlinks point to specific user folder path. Profile migration changes username path. Result: symlinks broken. Fix: re-create symlinks pointing to new OneDrive path. Open Admin cmd: mklink /D "C:\OldLink" "C:\Users\NewUser\OneDrive\TargetFolder". Or remove and re-create OneDrive folder mappings via OneDrive settings.

OneDrive uses local path like C:\Users\[name]\OneDrive\.... Symlinks pointing there break when username changes. Re-create symlinks with new path.

Symptom: OneDrive symlinks break after a profile migration on Windows 11.
Affects: Windows 11 with OneDrive.
Fix time: ~15 minutes.

ADVERTISEMENT

What causes this

Profile migration changes username, hence path. OneDrive’s sync folder typically C:\Users\[username]\OneDrive. Symlinks pointing to old path become broken. Tools using symlinks (Adobe Creative Cloud links, dev project pointers) fail.

Method 1: Identify and re-create symlinks

The standard route.

  1. List broken symlinks:
    Get-ChildItem -Path C:\ -Recurse -Force -ErrorAction SilentlyContinue | Where-Object {$_.LinkType -eq "SymbolicLink" -and -not (Test-Path $_.Target)}

    Slow but thorough.

  2. For specific known symlinks (you remember creating): verify they exist and target.
  3. To re-create symlink: open Admin cmd.
  4. del old symlink (file or empty rmdir for directory link).
  5. Re-create:
    mklink /D "C:\AliasFolder" "C:\Users\NewUser\OneDrive\TargetFolder"
  6. For PowerShell:
    Remove-Item "C:\AliasFolder"
    New-Item -ItemType SymbolicLink -Path "C:\AliasFolder" -Target "C:\Users\NewUser\OneDrive\TargetFolder"
  7. Test: navigate to alias; verify resolves to OneDrive folder.

This is the standard fix.

ADVERTISEMENT

Method 2: Find user-related symlinks via tools

For systematic discovery.

  1. Install NTFS Links or Junction Magic (free) to list all reparse points.
  2. Filter for those pointing to old user path.
  3. For each: note old target, find new equivalent, re-create.
  4. For Microsoft Sysinternals junction.exe: lists junctions specifically.
  5. For chronic: keep list of all symlinks for future migrations.
  6. For mass-fix script:
    $oldUser = "OldName"
    $newUser = "NewName"
    Get-ChildItem -Path C:\ -Recurse -Force -ErrorAction SilentlyContinue | Where-Object {
        $_.LinkType -eq "SymbolicLink" -and $_.Target -like "*$oldUser*"
    } | ForEach-Object {
        $oldLink = $_.FullName
        $newTarget = $_.Target -replace $oldUser, $newUser
        Remove-Item $oldLink
        New-Item -ItemType SymbolicLink -Path $oldLink -Target $newTarget
    }

    Test on one symlink first.

This is the systematic route.

Method 3: Reconfigure OneDrive sync from scratch

For clean slate.

  1. If extensive symlink breakage: reconfigure OneDrive.
  2. Open OneDrive (system tray icon).
  3. Settings → Unlink this PC.
  4. Re-sign in.
  5. OneDrive setup wizard: pick folder location (default C:\Users\[newuser]\OneDrive).
  6. Sync starts fresh.
  7. Re-create any symlinks to new path.
  8. For data already on local disk: OneDrive checks and syncs already-existing files.
  9. For PC Folder Backup (Desktop, Documents, Pictures auto-sync): re-enable in OneDrive settings.
  10. For chronic migration: avoid symlinks to user folders. Use Windows’s built-in Library / Known Folder redirection instead.

This is the clean-slate route.

How to verify the fix worked

  • Symlinks point to valid targets.
  • Apps using symlinks open files correctly.
  • OneDrive syncing as expected.
  • No “file not found” errors.

If none of these work

If symlinks still broken: OneDrive cache corrupt: clear OneDrive cache; resign in. For specific apps: app may have hardcoded paths. Reinstall or update config. For corporate OneDrive: SharePoint sync replaces. Different mechanism. For chronic migration scenarios: use junction reparse points (resolve at filesystem level, sometimes more robust than symlinks). For backup before migration: dump symlink list to file: dir /S /AL > symlinks.txt. For chronic OneDrive issues: contact OneDrive support; sometimes server-side state corrupted.

Bottom line: Re-create symlinks pointing to new user path. Use mklink /D for directories. PowerShell script for bulk fix. Reconfigure OneDrive from scratch if extensive breakage.

ADVERTISEMENT