Contents
- Overview
- Step 1: Add the file permissions in Microsoft Entra
- Step 2: Check permissions
- Step 3: Choose what to back up
- Step 4: Run the backup
- Step 5: Restoring
- What is covered, and what is not
- Troubleshooting
Backing up OneDrive with WholesaleBackup
Welcome to WholesaleBackup's guide to protecting OneDrive. Your backup client can back up and restore the files in each user's OneDrive straight from a customer's Microsoft 365 tenant, alongside their mail and the files and folders it already protects. Let's get started!
Why back up OneDrive at all?
OneDrive keeps your customer's files in sync. Sync is not backup: a file deleted, overwritten or encrypted on one device is deleted, overwritten or encrypted everywhere, within seconds. Microsoft's recycle bin and version history help for a while, but they are limited in time, they live inside the same tenant as the problem, and when an employee leaves, their OneDrive is deleted after a retention period the tenant controls.
WholesaleBackup keeps its own copy of every file, outside Microsoft 365:
- A version each time a file changes, so a file can be restored as it was on a given date, before the ransomware or the bad edit.
- Deleted files too, restorable until your retention setting ages them out.
What you need before you start
- Microsoft 365 already set up for mail backup, as described in Backing Up Microsoft 365 Mail, Calendars and Contacts (Steps 1 to 4). OneDrive uses the same applications and the same enrolled credentials. If you are starting fresh, follow that guide first; you can leave the mail permissions off if you only want OneDrive (see Backing up only mail, or only OneDrive).
- Global administrator access to the tenant, or an administrator who can grant tenant-wide consent, to add two permissions.
-
The build password for the client GUI, to open the
/cloudpage in Step 2. - Users with OneDrive. A user has a OneDrive only once their license includes it and they have opened it at least once.
Adding OneDrive to a tenant you already protect takes about five minutes. Nothing is enrolled again.
Step 1: Add the file permissions in Microsoft Entra
OneDrive needs one more permission on the backup application and one more on the restore application. You add them to the applications you registered for mail: you do not register new ones, and you do not enroll anything again in the backup client.
- Sign in to the Microsoft Entra admin center and go to Entra ID → App registrations.
- Open the application.
- Go to API permissions → Add a permission → Microsoft Graph → Application permissions.
- Search for the permission, check it, and click Add permissions.
Backup application (read-only)
| Permission | Needed to |
|---|---|
User.Read.All |
list users and find each user's OneDrive (already there if you back up mail) |
Files.Read.All |
read the files in users' OneDrive |
Restore application (write)
| Permission | Needed to |
|---|---|
User.Read.All |
find the OneDrive being restored into (already there if you restore mail) |
Sites.ReadWrite.All |
create the Restore folder and upload files into a OneDrive |
⚠️ Sites.ReadWrite.All belongs on the restore application only. It can write to every OneDrive and every SharePoint site in the tenant. That is what a restore into a user's OneDrive needs, and it is exactly the power a backup credential should never have. If you put it on the backup application, Check permissions will flag it (Step 2).
Grant admin consent
On each application's API permissions page, click Grant admin consent for <tenant> and confirm. Both new permissions should show Granted with a green check.
⚠️ As with mail, this step is not optional. Consent applies only to the permissions present when you click it, so a permission added afterwards needs consent again.
Backing up only mail, or only OneDrive
Mail and OneDrive are judged separately, so each customer gets only what they use:
-
Mail only: leave
Files.Read.AllandSites.ReadWrite.Alloff. Mail works exactly as before. Check permissions shows OneDrive as not ready, which is correct for this customer and is not a fault. -
OneDrive only: you can leave the mailbox permissions off.
User.Read.Allis still needed, to list the users.
Using a single application for both
The advice in the mail guide applies with more force here. A single application holding Sites.ReadWrite.All is permitted to rewrite every user's files, every night, unattended. Keep backup and restore as two applications, and the credential in routine use can only read.
Step 2: Check permissions
On the /cloud page, click Check permissions beside each Microsoft 365 credential. As in the mail guide, this asks Microsoft for a token and reads back what it actually carries, so it is the only way to be sure consent took effect.
The result now has one line per service, Mail and OneDrive, each marked ready or missing, with any missing permission named beside what it is needed for. Above them is a summary:
| Summary | What it means |
|---|---|
| This credential is ready for Mail and OneDrive. | Everything is in place for both. |
| Ready for Mail. Not ready for OneDrive. | Mail works as before; the OneDrive line names what to add. Correct for a customer who backs up mail only. |
| Ready for OneDrive. Not ready for Mail. | Correct for a customer who backs up OneDrive only. |
| This credential is missing permissions and will fail. | Neither service can work. Add what the lines name. |
A "not ready" line for a service the customer does not use is not a fault. A credential ready for one service is never reported broken for lacking the other, so an existing mail customer who never adds OneDrive sees no change.
On a backup credential, Sites.ReadWrite.All or Files.ReadWrite.All is reported as more than it needs. The backup will work, but the credential could alter users' files. See Step 1 on why that is worth avoiding.
After adding a permission in Entra, just click Check permissions again. The credential does not need to be enrolled again.
Step 3: Choose what to back up
Go to Backup → Selections and expand Microsoft 365. Each user now opens into two rows, Mail and OneDrive, instead of being a single mailbox:
-
Microsoft 365
-
Contoso Ltd, the tenant
- All users' mail
-
Joe Smith, a user
- Mail: opens into mail folders, exactly as the mailbox did before
- OneDrive: opens into the folders in Joe's OneDrive
-
Amy Jones, a user
- OneDrive
-
Contoso Ltd, the tenant
A mailbox you had already selected shows as selected on its Mail row. Nothing about existing mail selections changes.
Each level is fetched only when you expand it, and a OneDrive's folders are read live from Microsoft, so the tree shows the folders as they are right now.
Whole OneDrive, or named folders?
Check the OneDrive row itself to back up the user's whole OneDrive. This is the right default: like a whole mailbox, it follows the drive as it changes, so a folder created next month is included automatically. The folders under a checked OneDrive are covered even though their own boxes stay empty.
Check a named folder instead to back up just that folder and everything beneath it.
Excluding a folder
Check the OneDrive, then click a folder inside it until it shows as excluded. An exclusion covers everything beneath that folder, including subfolders created later.
OneDrive treats folder names without regard to case, and so do selections: an exclusion of finance excludes a folder named Finance.
OneDrive is chosen user by user
⚠️ The All users' mail row covers every mailbox in the tenant, including people added later, but not their OneDrive. Check each user's OneDrive row you want backed up. When the customer adds a new employee, check their OneDrive row, or it will not be backed up.
OneNote notebooks
A notebook in OneDrive shows with a book icon and has no arrow to expand. It is backed up whole, as the set of section files OneDrive keeps it in. See A note on OneNote notebooks for how a notebook comes back.
When the OneDrive row cannot be checked
- The row is grayed out: the backup credential has no file permission. Hover over it for the exact permission to add in Entra (Step 1). The row is shown rather than hidden, so you know OneDrive is available.
- A notice says the user has no OneDrive yet: Microsoft creates a user's OneDrive the first time they open it, if their license includes it. You can check the row now anyway: backups start once the OneDrive exists.
Step 4: Run the backup
OneDrive backs up as part of the ordinary backup, the same as mail. There is no separate schedule, no separate job, and nothing extra to start. Run a backup as you always would, or wait for the schedule.
What to expect on the first run
The first backup downloads every file in the selection, so it takes far longer than later ones. In our testing, a OneDrive of several thousand small files backed up at roughly 600 files a minute. A drive of large files is limited by how fast this computer can upload to your backup storage, not by Microsoft.
Every run after the first fetches only what changed. A file is judged changed by its size and the content hash Microsoft keeps for it, so renaming or moving a file does not download it again.
Reading the log
The backup log has one line per user's OneDrive:
OneDrive [joe@contoso.com]: 5120 item(s) of 2.00 GB selected (5000 file(s), 120 folder(s), 0 notebook(s)); 1 new or changed, 0 no longer selected, 0 newly deleted, 0 flagged as malware (listing 5500 item(s) over 28 page(s))
and a total for the files it stored:
OneDrive backup: 5000 stored, 0 failed; 2000000000 byte(s)
"Newly deleted" and "no longer selected" are different things. Newly deleted means the file is gone from OneDrive. No longer selected means it is still in OneDrive but now outside what you selected, for example because you excluded its folder. Either way the backed-up copies are kept, as described below.
Throttling
Microsoft limits how fast any one application may read a tenant. When it asks the client to slow down, the log says so:
OneDrive backup: Microsoft is throttling this app (HTTP 429); every OneDrive download waits 8 s (its Retry-After).
That is information, not an error. Every download pauses for the time Microsoft asks, as Microsoft requires of backup applications, and the files are fetched afterwards. A large first backup will usually show a few of these lines.
Changed files keep their earlier versions
When a file changes, the new version is backed up and the previous one is kept. You can then restore the file as it was on a given date (Step 5). This is the protection against ransomware and against an edit someone regrets.
Deleted files are kept
When a file disappears from OneDrive, the client marks it deleted in the catalog rather than discarding it. It stays restorable until your retention setting ages it out. As with mail, a file is only ever treated as deleted when Microsoft's listing of the drive was complete.
Step 5: Restoring
Go to Restore and choose Microsoft 365 OneDrive in the Restore selector at the top of the page. The entry appears only once this computer holds a OneDrive backup.
The page lists what was backed up, not what is in OneDrive now. Files deleted from OneDrive are still here, and are usually why the customer called.
Finding what you need
- Pick the Account: the user whose OneDrive it was.
- Set Show to Everything backed up, Still in OneDrive, or No longer in OneDrive. The last is the one to reach for when someone has lost a file.
- Pick a folder in the folder pane on the left. The top row, OneDrive, is the whole drive.
- Check individual files, or leave them all unchecked to restore the folder and everything beneath it.
To find a file without knowing its folder, type part of its name in Search file names in this account. Results show each file's folder, and checks are kept as you move between folders and searches.
The button always says what it will do before you press it, for example Restore Finance and its subfolders (42 files) or Restore 3 ticked files.
Restoring as of a date
Leave Version blank for the newest copy of each file. Pick a date and time to get each file as the backup held it then: the version from before the ransomware ran or the bad edit was saved. A file that was not yet backed up by that time is left out.
Check Go by when each file was last changed in OneDrive to use Microsoft's modified date instead of the backup date.
A file renamed or moved since comes back under its current name and folder: earlier versions keep the contents, not the old name.
Choosing where it goes
| Destination | What happens |
|---|---|
| Files on this computer | The files are written into a folder you name, under OneDrive\<user>\ with the user's folders recreated, each with its original modified date. Nothing in OneDrive is touched. |
| Back into OneDrive | The files go into a new folder at the top of a OneDrive, with their original created and modified dates. Nothing already in OneDrive is changed, moved, overwritten or re-shared. |
A restore to this computer never overwrites anything: a name that is taken gets " (2)". A file named _divinsa_restore_manifest.csv beside the restored files lists everything restored, and why anything was renamed or skipped. Names Windows will not accept are adjusted, and folders deeper than Windows' usual 260-character path limit restore normally.
Restoring back into OneDrive
- Into whose OneDrive: leave it blank to put the files back where they came from. Enter another user's address to hand them to someone else, for example a departed employee's files to their manager.
-
Name for the new folder: leave it blank and the folder is named after the date and time, such as
Restore 2026-11-20 14.22.01. If that name is taken, you getRestore 2026-11-20 14.22.01 (2). - The restored files are shared with no one, whatever their sharing was when they were backed up. Share them again from OneDrive if needed.
-
It needs the restore credential, with
Sites.ReadWrite.All(Step 1). The backup credential cannot write, by design.
Each file is checked twice: against the content hash Microsoft gave when it was backed up, and against the hash OneDrive reports after the upload. A file that fails either check is reported as failed, never as restored.
While it runs
The page shows that the restore is working, and then how many files were restored, skipped and failed. A large restore takes a while; you can leave the page and come back. It also appears in Details as a cloud restore session with its own log, alongside every other operation.
What is covered, and what is not
| Item | Backs up | Restores to this computer | Restores into OneDrive |
|---|---|---|---|
| Files in the user's own OneDrive | Yes | Yes | Yes |
| Folders, including empty ones | Yes | Yes | Yes |
| Earlier versions of a changed file | Yes, one per backup that saw a change | Yes, by date | Yes, by date |
| OneNote notebooks | Yes, as their section files | As section files | As a folder of section files |
| Files other people shared with the user | No: backed up from their owner | ||
| SharePoint sites and Teams files | Not yet | ||
| Sharing links and permissions | No | Restored files are shared with no one | |
| Files Microsoft has flagged as malware | Listed, not downloaded |
Files shared with a user belong to the person who shared them. They are backed up from the owner's OneDrive, not from everyone they were shared with. To protect them, check the owner's OneDrive.
The versions are the backup's own, one each time a backup saw the file had changed. Microsoft's version history inside OneDrive is not copied.
A note on OneNote notebooks
OneDrive keeps a notebook as a special folder of section files (.one) and a table of contents (.onetoc2). Those files are backed up and restored byte for byte, but a notebook restored into OneDrive comes back as a plain folder of those files, and OneNote does not open it as a notebook. Its contents are all there; they are simply not reassembled into a live notebook, because Microsoft offers no way for a backup application to recreate one.
If a customer depends on OneNote, tell them this before they rely on it.
When an employee leaves
When a user's account is deleted, Microsoft keeps their OneDrive for a retention period the tenant controls (30 days unless an administrator has changed it), and then deletes it for good.
The backup does not follow Microsoft's clock. What was backed up stays restorable until your own retention setting ages it out. Within that time you can restore a departed employee's files into a colleague's OneDrive (Into whose OneDrive, Step 5) or to this computer. If the files matter, do that while they are still in your retention window.
Names and path lengths
OneDrive refuses some names that a backup can still hold, and a restore into OneDrive adjusts them rather than failing:
- the characters
: ? * " < > | \become_ - leading and trailing spaces, and trailing dots, are removed
- device names such as
CONorNUL, and names beginning_vti_, get a_in front
OneDrive also limits a file's whole path to 400 characters, and it counts the hidden start of every OneDrive address, personal/<user>/Documents/, which uses about 40 to 50 of them. A file deep enough to go over once it sits inside the new Restore folder is reported as failed, with the reason, before anything is created for it. Restore that file to this computer instead, where the limit does not apply.
Retention
OneDrive files follow the same retention setting as everything else the client backs up. A file deleted from OneDrive, an earlier version, and a file that is no longer selected all stay restorable until your retention window passes, then age out with the rest.
Troubleshooting
The OneDrive rows are grayed out in Selections
The backup credential has no file permission. Hover over a row for the exact permission. Add Files.Read.All to the backup application, grant admin consent (Step 1), and reopen the tree. The log says the same on every run until it is fixed:
OneDrive [joe@contoso.com] was not scanned: the credential has no file permission. NO deletions are inferred.
Nothing already backed up is marked deleted while the permission is missing.
"This user has no OneDrive yet"
The user has never opened OneDrive, or their license does not include it. It is reported as information, not an error, and nothing already backed up is aged by it. The backup starts on its own once the user opens OneDrive.
A new employee's files are not being backed up
OneDrive is chosen user by user. All users' mail covers new mailboxes, not new OneDrives. Check the new user's OneDrive row in Selections.
Microsoft 365 OneDrive is missing from the Restore selector
This computer holds no OneDrive backup yet. The entry appears after the first backup that includes a OneDrive.
A restore into OneDrive fails with "refused (403)"
The restore credential lacks Sites.ReadWrite.All. Add it to the restore application, grant admin consent, and run the restore again. Restores to this computer are unaffected.
"Its path would be longer than OneDrive's 400 characters"
That file sits too deep to fit in OneDrive under the new Restore folder. Nothing was created for it, and the rest of the restore carries on. Restore it to this computer instead. Choosing a lower folder on the Restore page does not help: a restore always recreates a file's full folder path from the top of the drive.
A restored notebook does not open in OneNote
This is expected. A notebook comes back as a folder of its section files, all present, but OneNote does not reopen it as a notebook (see A note on OneNote notebooks).
The log shows "Microsoft is throttling this app"
This is normal on a large backup. Every download waits the time Microsoft asks, and the files are fetched afterwards. It is only worth a look if the run then reports files as failed.
Backups worked for months and now fail to authenticate
The client secret expired. It is the same secret mail uses, so mail stops at the same time. Create a new secret in Entra and enroll the same tenant and client ID again with the new value, as described in the mail guide.
Still stuck?
The backup log names every user, file and decision, and the restore log names where each file went. Send the relevant log to support@wholesalebackup.com and we will take a look.
If you find anything in this guide unclear, please send your questions, comments and feedback to support@wholesalebackup.com and we will revise the guide accordingly.