About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
Microsoft's page says: "After a tenant-to-tenant migration, a User Principal Name (UPN) change, or a password update, OneDrive for Business might be unable to sync." Its fix is to clear the cached credentials: sign out of OneDrive for Business, remove the two folders %localappdata%/Microsoft/OneAuth and %localappdata%/Microsoft/IdentityCache, then sign in again. A UPN change has a second documented behaviour: while the change spreads through the environment the sync app can show "One or more libraries couldn't be synced", and Microsoft says users who see this should restart the sync app; the error goes away when the change is fully propagated.
What the error means
OneDrive for Business keeps sign-in information on the device. After the identity behind it changes, that stored information can be out of step with the account. Microsoft's page does not show an error code or an error message for this case. It names three triggers and one fix.
A UPN change also moves the user's OneDrive address. Microsoft's pages give the address format as https://contoso-my.sharepoint.com/personal/user1_contoso_com, built from the tenant name and the UPN. A change of UPN prefix or suffix changes that address, as the UPN page shows. A move to a different tenant would also be expected to change it, because the tenant name is part of the format.
Microsoft's UPN page says the sync app on Windows and Mac "will automatically switch to sync with the new OneDrive location after a UPN change", and that "UPN changes can take several hours to propagate through your environment." The two documented cases are different:
- Cached sign-in information is stale. The fix is the clearing steps above.
- The change is still spreading. The fix is to restart the sync app and wait.
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| Stale cached credentials after a tenant move, UPN change or password update | OneDrive for Business will not sync or will not sign in | The user's tenant, UPN or password changed since the last good sync; the two folders exist |
| UPN change still propagating | "One or more libraries couldn't be synced"; details say "You don't have permission to sync this library." | The UPN change was made within the last several hours |
| The OneDrive address changed and a saved link points to the old one | A shortcut, favourite or Recent list entry fails | Compare the address in the browser with the saved link (usage report shows the current URL) |
| A new account reused an old UPN | "Access denied" or a OneDrive address with a number or GUID on the end | The address ends with a suffix; this is the user ID mismatch Microsoft describes for SharePoint and OneDrive, a separate fault from stale cached credentials |
| Old Office activation remains on the device | Office apps show the old account | The activation page lists tenant-to-tenant migration as a reason to clear prior activations |
Prove the cause before changing anything
All read-only.
- Record the account OneDrive is signed in with, and the date and time of the change (migration, UPN change or password update). In an elevated or standard Command Prompt:
whoami /upn
Microsoft's whoami page says /upn "Displays the user name in user principal name (UPN) format." This is the Windows sign-in name, which may differ from the account OneDrive uses, so also read the account name in the OneDrive settings.
- Find the user's current OneDrive address. In the Microsoft 365 admin center, the OneDrive usage report lists users and URLs; Microsoft's page says to sign in as a SharePoint Administrator or reports reader, and, if the table shows GUIDs instead of names, to clear the box "In all reports, display deidentified names for users, groups, and sites."
- On an Entra-joined device, check which tenant the device is joined to:
dsregcmd /status
The tenant details section shows TenantName and TenantId. If these still name the old tenant, clearing OneDrive caches does not change the device's own join; that is a separate job for whoever owns device management.
- Check that the two folders exist. Paste
%localappdata%\Microsoftinto File Explorer's address bar and look forOneAuthandIdentityCache. Do not change anything yet. - If the UPN change was made within the last several hours, stop here: restart the OneDrive sync app and wait before clearing anything.
Example (illustrative): contoso.com.au moves 15 mailboxes and OneDrive accounts into a new tenant on a Saturday. By Monday morning 12 users sync as expected and 3 do not, which is 20 per cent of the group. dsregcmd /status on one affected laptop, lt-022, still lists the old tenant, so for that user the OneDrive clearing will not be enough. The other two affected laptops show the new tenant, so for those two the clearing steps apply.
Fix
Clear cached credentials (Microsoft's documented fix)
The page gives three steps: sign out of OneDrive for Business; remove the two folders; sign in to OneDrive for Business. Do them in this safer form, which renames instead of removing so there is a way back.
- Check the OneDrive status. If files show as waiting to upload, let them finish or copy them to a folder outside OneDrive. Risk: signing out stops syncing for that account, so unsynced changes stay only on the device until the user signs in again. Back-out: sign in to OneDrive again.
- Sign out of OneDrive for Business, as the page says.
Disruptive step: the next two commands rename the two folders that hold cached credentials. Once they are renamed, other Microsoft 365 apps for that Windows user may ask to sign in again. Impact: a short interruption for that user on that device. Back-out (the folders are renamed, not removed, so they can be put back): sign out of OneDrive and close it, rename the newly created folders with ren "%localappdata%\Microsoft\OneAuth" OneAuth.new and ren "%localappdata%\Microsoft\IdentityCache" IdentityCache.new, then run ren "%localappdata%\Microsoft\OneAuth.old" OneAuth and ren "%localappdata%\Microsoft\IdentityCache.old" IdentityCache. A rename fails with "Duplicate file name or file not found" if the new name already exists, so the .old folders must not already be present from an earlier attempt. If Windows reports a folder in use, make sure OneDrive is signed out and closed (do not end the process while files are uploading) and try again.
- Rename the first folder in a Command Prompt:
ren "%localappdata%\Microsoft\OneAuth" OneAuth.old
- Rename the second folder:
ren "%localappdata%\Microsoft\IdentityCache" IdentityCache.old
- Sign in to OneDrive for Business with the current account. Microsoft's page gives no other step.
- Risk: deleting the renamed
.oldfolders in this step cannot be undone, so keep them until you are sure. When sync is healthy for a few days, and only then, the renamed.oldfolders can be deleted.
If the UPN change is still propagating
Microsoft's UPN page says users who see "One or more libraries couldn't be synced" should restart the sync app, and that "The error goes away when the UPN change is fully propagated and the sync app is updated to use the user's new OneDrive URL." Restart the sync app and wait. If the message remains after several hours, move on to the clearing steps above.
If the user also lost links and shortcuts
After a UPN change, the UPN page lists these effects: saved links to the user's OneDrive stop working; links to files shared by the user stop working and the user needs to reshare them; OneNote notebooks stored in OneDrive need closing and reopening; OneDrive in Teams can show "404 Files not found"; and workflows or apps that name the old OneDrive address need updating. These are separate from the sync fault.
If Office also shows the old account
Microsoft's activation page lists "Tenant to tenant migration" among the reasons to clear prior activations of Microsoft 365 Apps for enterprise, and its steps include editing the registry and removing credentials. Do not mix its steps into this fix: they edit the registry and need their own save-first steps.
Confirm the fix
- The OneDrive icon shows a normal status and the account is the new one.
- A new file in the OneDrive folder appears in OneDrive on the web, and a change made on the web appears on the device.
- The user's OneDrive address in the browser matches the one in the usage report.
- Other Microsoft 365 apps on the device are signed in to the same account.
What to watch afterwards
- Users who were not touched by the first round. A migration or a group of UPN changes affects many accounts; the same fix applies to each device.
- Saved links and shared links, which the UPN page says stop working after a UPN change.
- Devices that were off during the change. They meet the fault when they next start.
- Whether the error repeats after the next password update. If it does, check the device's join state and network access; Microsoft's page names no cause for a repeat.
Read next
Related articles you may want next.
- TroubleshootingOneDrive error 0x8004de40 or 0x8004de88: Can't sign in, the sync client can't reach the cloudOneDrive error 0x8004de40 or 0x8004de88 means it can't connect to the cloud. Check TLS, cipher suites and device join state with Microsoft's own steps.Read article
- TroubleshootingSharePoint or OneDrive Access denied after a user is deleted and recreated: site user ID mismatchNew account, same username, now Access denied or a OneDrive URL with a suffix? Fix the site user ID mismatch with Microsoft's diagnostic, safely.Read article
- HostingHypercare in the first 72 hours after a hosted migrationWhat to monitor, how long to keep elevated support and war-room habits, and when to declare normal operations after cutover.Read article
Risks and limits
These commands have not been run or lab-tested.
- Microsoft's sync page gives no time for the fix, lists no error code, and does not say whether other apps share the two folders. Check on the device whether other Microsoft 365 apps ask to sign in again after the rename; that warning is a precaution, not a statement from Microsoft.
- Microsoft's sync page does not cover re-joining a device to a new tenant, mailbox migration, or moving the content of OneDrive itself.
- Renaming rather than removing the folders is a safer way to follow the page's "remove" step. The page itself says remove.
- A UPN change can take several hours to spread. Clearing credentials during that time can add work without fixing anything.
- A sync error that shows "Access denied" is a different case: the user ID mismatch in the table above, not stale cached credentials.
Sources
- OneDrive for Business can't sync after tenant migration — Microsoft Learn, page dated 2025-07-14, accessed 20 November 2026
- How UPN changes affect OneDrive — Microsoft Learn, page dated 2025-04-04, accessed 20 November 2026
- View the list of OneDrive URLs for users in your organization — Microsoft Learn, page dated 2025-04-05, accessed 20 November 2026
- Reset activation state for Microsoft 365 Apps for enterprise — Microsoft Learn, page dated 2026-08-26, accessed 20 November 2026
- Troubleshoot devices by using the dsregcmd command — Microsoft Learn, page dated 2025-06-27, accessed 20 November 2026
- Fix site user ID mismatch in SharePoint or OneDrive — Microsoft Learn, page dated 2026-08-18, accessed 20 November 2026
- whoami — Microsoft Learn, page dated 2025-05-26, accessed 20 November 2026
- ren — Microsoft Learn, page dated 2024-11-01, accessed 20 November 2026
This article was originally published on .