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.
Affects: Windows 11 with OneDrive.
Fix time: ~15 minutes.
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.
- List broken symlinks:
Get-ChildItem -Path C:\ -Recurse -Force -ErrorAction SilentlyContinue | Where-Object {$_.LinkType -eq "SymbolicLink" -and -not (Test-Path $_.Target)}Slow but thorough.
- For specific known symlinks (you remember creating): verify they exist and target.
- To re-create symlink: open Admin cmd.
delold symlink (file or empty rmdir for directory link).- Re-create:
mklink /D "C:\AliasFolder" "C:\Users\NewUser\OneDrive\TargetFolder" - For PowerShell:
Remove-Item "C:\AliasFolder" New-Item -ItemType SymbolicLink -Path "C:\AliasFolder" -Target "C:\Users\NewUser\OneDrive\TargetFolder" - Test: navigate to alias; verify resolves to OneDrive folder.
This is the standard fix.
Method 2: Find user-related symlinks via tools
For systematic discovery.
- Install NTFS Links or Junction Magic (free) to list all reparse points.
- Filter for those pointing to old user path.
- For each: note old target, find new equivalent, re-create.
- For Microsoft Sysinternals junction.exe: lists junctions specifically.
- For chronic: keep list of all symlinks for future migrations.
- 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.
- If extensive symlink breakage: reconfigure OneDrive.
- Open OneDrive (system tray icon).
- Settings → Unlink this PC.
- Re-sign in.
- OneDrive setup wizard: pick folder location (default
C:\Users\[newuser]\OneDrive). - Sync starts fresh.
- Re-create any symlinks to new path.
- For data already on local disk: OneDrive checks and syncs already-existing files.
- For PC Folder Backup (Desktop, Documents, Pictures auto-sync): re-enable in OneDrive settings.
- 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.