A Microsoft file hosting and synchronization service.
The duplicate folder behavior matches the documented OneDrive behavior when sync is stopped and then started again: OneDrive creates a new local folder, and if the same name already exists, it adds a number such as 1, 2, and so on.
For macOS, the supported recovery path is:
- In the menu bar, select the OneDrive cloud icon.
- Select Help & Settings > Preferences.
- Open the Account tab.
- Select Unlink this Mac.
- Clear sign-in credentials in Keychain Access:
- Open Keychain Access.
- If keychains are not visible, select Window > Keychain Access.
- Select a keychain in the Keychains list.
- Select File > Delete Keychain
[OneDrive/Office/MS]. - Select Delete References.
- Sign in again.
- When prompted that a OneDrive folder already exists, select Use this folder if the existing folder is the correct one. If a new location is preferred, select Choose new folder.
- Let OneDrive resync.
Important points for the scenario described:
- Unlinking and re-linking does not delete data. The local folders are temporarily disconnected and changes sync again after re-linking completes.
- If OneDrive starts syncing the library again after being disconnected, a duplicate folder with a suffix like
(2)is expected behavior when the original folder name already exists. - If the issue continues after unlink/re-link, the next documented step on Mac is to reset OneDrive.
On the credentials question: the supported Mac guidance is to clear OneDrive sign-in credentials through Keychain Access by deleting the relevant OneDrive/Office/MS keychain references. The provided context does not document the behavior of RemoveOneDriveCreds.command, so only the Keychain Access method is supported here.