04 66 72 51 22

OneDrive files marked as “online-only” are not backed up

This page is intended for administrators backing up Windows workstations with OneDrive installed. It explains why files in a OneDrive folder may be missing from a backup, and how BeBackup can force them to be present on the workstation.

Symptom

A user's OneDrive folder is included in the profile selection. Yet some files are missing from the backup. In Windows Explorer, these files display a cloud icon: they are "available online only".

The backup report includes an information line of this type:

N file(s) available online only (OneDrive…) were not backed up: their content is not on the disk. Examples: … To back them up, choose "Always keep on this device"…

Cause

OneDrive offers the Files On-Demand feature. With it, a file can remain in the Microsoft cloud. The workstation then keeps only an empty entry representing it. The content is downloaded only when a program opens it.

A backup reads the files present on the workstation's disk. The agent never reads a file that is available online only: doing so would force it to download. It treats the file as unchanged (any previously backed-up version remains in place) and counts it in the information line above. A file of this kind that has never been present on the workstation is therefore not backed up.

For a one-off fix, right-click the folder in Windows Explorer and choose "Always keep on this device". To enforce this across all workstations, follow the fix below.

Fix: enforcing the "Files On-Demand" setting

BeBackup can enforce this setting on the workstation, through the Windows policy provided by Microsoft. The setting is configured via an advanced agent option.

  1. In the web interface, open the backup settings for the device, the company or the provider.
  2. In the Advanced agent options field, add OneDriveForceFilesOnDemandEnabled=0. Separate multiple options with ;.
  3. Save.

At the start of each backup, the agent writes the FilesOnDemandEnabled value to the HKLM\SOFTWARE\Policies\Microsoft\OneDrive registry key, based on the options it already knows. An option entered in the web interface only reaches the agent during the next backup: it is therefore only written at the backup after that.

ValueEffect
0Files On-Demand is disabled: OneDrive keeps all files on the workstation.
1Files On-Demand is enabled.
-1The agent removes the policy: the setting reverts to the user.

Any value that is not a number counts as 0.

With the value 0, OneDrive downloads all of the user's files to the workstation. Check that the workstation's disk has enough free space before applying the option.

Removing the option from the field does not remove the policy already written on the workstation. To remove it, use the value -1 for at least one backup.

Checking that it worked

  1. Run two backups of the workstation.
  2. On the workstation, open the registry editor and check the FilesOnDemandEnabled value in HKLM\SOFTWARE\Policies\Microsoft\OneDrive.
  3. Wait until OneDrive has downloaded the files. The cloud icons disappear in Explorer.
  4. Run a new backup, then check its report: the line "… available online only (OneDrive…) were not backed up" should no longer appear.

Possible messages

If the agent cannot write the policy, the report states:

Error while setting the OneDrive "Files On-Demand" option: …

The text that follows gives the reason. The backup continues despite this error.

Outside Windows (Mac, Linux, Synology), this policy does not exist. The report states:

The OneDrive "Files On-Demand" option cannot be enforced on this platform. Files stored online only may not be downloaded, and therefore may not be backed up.

On these platforms, configure OneDrive directly on the workstation to keep files locally.

If the problem persists

If files are still missing even though the policy is in place, contact BeBackup support. Include the backup report and the path of a missing file.

BeBackup is backup built for IT service providers

Backup and restore of workstations, servers, virtual machines and Microsoft 365, encrypted at source with a key we do not hold, on the hosting of your choice.