Technology in terms you understand. Sign up for the Confident Computing newsletter for weekly solutions to make your life easier. Click here and get The Ask Leo! Guide to Staying Safe on the Internet — FREE Edition as my thank you for subscribing!

How Files On-Demand Affect Recovering OneDrive Files

A space-saving feature that is important to understand.

OneDrive's Files On-Demand feature may confuse you into thinking you have a file on your computer that you do not.
OneDrive
(Image: DALL-E 3)
Question: I had just mistakenly deleted some files from my OneDrive account that I could not retrieve. Luckily, I have a pc that has been taken off from the internet for over a year, that has those files (may not be current) that I would like to copy back to my OneDrive account. I did not want to reconnect this pc to the internet and sync the files, afraid that the files will be lost as the local OneDrive folder is syncing with the online folder. I could not cut and paste the files from the old pc onto a usb drive due to an error code: 0x8007016A. I searched this error code up and found out that the cloud server is not running. All the files on the old pc also have a gray x at the lower left corner of their icons.
Do you have recommendations allowing me to safely copy those files to an external usb drive so that I can take to another pc with internet connection and update the online OneDrive folder? I greatly appreciate your help.

I have a straw to grasp at, but I’m pretty sure it won’t involve that other PC. I’ll describe why because it’s an important concept to understand when backing up the contents of OneDrive.

Become a Patron of Ask Leo! and go ad-free!

TL;DR:

OneDrive's Files On-Demand and data recovery

To retrieve mistakenly deleted OneDrive files without reconnecting an offline PC, check OneDrive.com’s Recycle Bin online first. If files aren’t there, it’s possible they’re lost forever — even if the files seem to appear on another offline PC — because of OneDrive’s Download-On-Demand feature. That feature is important to understand in order to use it safely.

The straw to grasp at

As soon as you can, visit OneDrive.com online, signing in with the same Microsoft account you use for OneDrive on your PC.

Click on Recycle bin.

Recycle Bin at OneDrive.com.
Recycle Bin at OneDrive.com. (Screenshot: askleo.com)

Much like your PC’s recycle bin, the OneDrive recycle bin keeps your most recently deleted OneDrive files. The catch is that it only keeps them for “a while”. For personal plans, that’s 30 days. (Business and school OneDrive accounts may have a longer retention period.)

If you can find your accidentally deleted files there, you can restore them, and you’re done. Congratulations.

If you can’t, then I’m afraid I have some bad news.

Dealing with storage space

It’s not uncommon for a OneDrive account to contain more data than the computer has room for. For example, if my OneDrive has 500GB (gigabytes) of data in it but my computer has only 200GB of available space, that’s a problem.

OneDrive has two solutions to this problem: “Choose folders” and Files On-Demand.

“Choose folders” allows you to completely hide a folder within your OneDrive from a particular PC. The folder remains in OneDrive in the cloud (and perhaps on other computers), but on the computer using this feature, it’s as if those folders don’t exist. They don’t show up on or take up any space on your PC.

That feature doesn’t apply to our situation here.

Files On-Demand, on the other hand, absolutely does.

A file’s name versus its data

There are two components to a file that we’re concerned about here.

  • A file’s name is just that: the name you assign to a file so you can know what file you’re dealing with. For example, “example.docx” is a file name.
  • A file’s data is the contents of your document. For example, if I’ve written my next great novel and saved it as “example.docx”, then “example.docx” is its name, and my novel is the data contained within.

In a nutshell, Files On-Demand means:

  • The file’s names are always shown within your OneDrive folder on your PC.
  • The file’s data isn’t downloaded to your PC until you need it. Typically, that means it’s downloaded if you try to open the file.

So if my example.docx is using Files On-Demand, then I may see the filename on my PC, but its data — my novel — is not on my PC at all. Only when I open the document while I’m online is the data then finally downloaded to my PC.

What this means is that only files you actually use take up space on your PC. Anything else shows only as a name; no data is downloaded.

Knowing what’s where

When the OneDrive app is running, files within the OneDrive folder show a small status symbol on their icons. These tell you the state of the file.

OneDrive White check The file is designated as “Always keep on this device”, and is unaffected by on-demand. It’s always on your computer.
OneDrive blue cloud The file’s data has not been downloaded and is not taking up space on your machine; it’s only in the cloud.
OneDrive green check The file is an on-demand file, but its data has been downloaded and is on your PC.
OneDrive sync The file needs to be or is currently being synchronized with OneDrive in the cloud.
× The file’s data has not been downloaded and there is a problem preventing it from being downloaded.

Controlling what’s where globally

Files On Demand settings in OneDrive settings.
Files On-Demand settings in OneDrive settings. (Screenshot: askleo.com)

The Files On-Demand feature is always available and typically defaults to “On” for all your files. That means that when you first set up OneDrive and connect it to your OneDrive.com files online, only the names will be downloaded; the data will not. This means you can see all your OneDrive files, but their actual contents are not yet downloaded to your PC.

That might be all you need. It uses the least amount of disk space, and the files you need are automatically downloaded as you use them.

In the OneDrive settings shown above, you can click Download all files, and this will download the data for all the files in your OneDrive1. All files will be on your PC, and new files added will automatically include their data. This is as close as you can get to turning the feature off completely.

At the other end of the spectrum, you can click on Free up disk space. This will remove all data for all files in OneDrive from your PC. All files will continue to be listed, and the data will be downloaded for each file the next time you use it.

Controlling what’s where file by file

Right-click on a file in OneDrive, and you’ll see options to control its On-Demand state.

A file that is currently "on-demand".
A file that is currently on-demand. Click for larger image. (Screenshot: askleo.com)

The file test-example-1 above is currently on-demand. The hollow cloud icon indicates that while its name appears, the file’s data has not been downloaded. You can cause the data to be downloaded either of two ways:

  • Open the file. The data will be downloaded on-demand. The icon will change to a hollow-circled checkmark, indicating it’s an on-demand file that has been downloaded.
  • Right-click the file and then click on “Always keep on this device”. This causes the data to be downloaded. The icon changes to a solid circled checkmark. This file remains on your machine until or unless you change that state or delete the file from OneDrive (here, at OneDrive.com, or at any PC linked to this same OneDrive account).
A file that is on-device.
An on-device file. Click for larger image. (Screenshot: askleo.com)

In this example, test-example-2 is completely downloaded and on your PC, as indicated by the solid circled checkmark. Right-click on the file and you’ll see that “Always keep on this device” shows a checkmark in front of it as well. You can click on Free up space, and the data will be removed only from your PC, freeing up the space. To use the file again, you’ll need to download the data using one of the methods above.

Why does any of this matter?

If you want to copy a file from OneDrive on your PC to another location — perhaps another drive or to back up the file — both that file’s name and data must be on your PC.

If the file’s data is not on your PC, then to download it, you must be connected to the internet with the OneDrive app running.

If the file’s data is not on your PC and you are not connected to the internet, or the OneDrive app is not running or connected, you are unable to download it.

Coming full circle to the original question

Now that we understand how OneDrive handles files, and how this on-demand feature works, we can address the original question more completely.

I have a pc that has been taken off from the internet for over a year, that has those files (may not be current) that I would like to copy back to my OneDrive account. I did not want to reconnect this pc to the internet and sync the files, afraid that the files will be lost as the local one drive folder is syncing with the online folder. I could not cut and paste the files from the old pc onto a usb drive due to an error code: 0x8007016A. I searched this error code up and found out that the cloud server is not running. All the files on the old pc also have a gray x at the lower left corner of their icons.

The files have already been lost.

If they’re not in OneDrive’s recycle bin, then:

  • The files have been removed from the original computer, where you deleted them.
  • The files have been removed from OneDrive online.

That this older computer lists the files with a gray x, and that it’s complaining about the “cloud server not running”, means that:

  • The files are on-demand, meaning the file’s data is not on this older computer.
  • The computer is trying to fetch the data, but it’s having trouble doing so, probably because OneDrive is not connected.
  • Even if OneDrive was connected, the files have been removed from OneDrive online, so there’s nowhere to get the data from.

Do this

I realize that this on-demand feature of OneDrive seems complex. In a sense, it is, and it has some ramifications that might not be obvious from the start. Hopefully now you’ll understand what’s needed to make sure that a file — the entire file — is present on your PC.

I try to clarify topics like this often. Subscribe to Confident Computing! Less frustration and more confidence, solutions, answers, and tips in your inbox every week.

Podcast audio

Play

Footnotes & References

1: Except those that live in folders you’ve chosen to hide on this PC using “Choose folders”.

5 comments on “How Files On-Demand Affect Recovering OneDrive Files”

  1. When I first started using OneDrive it didn’t take me long to spot the possible implications of not setting up OneDrive to meet my requirements. Saving disk space isn’t one them. When purchasing a new PC or laptop, I’ve found it less expensive to go ahead and buy one that comes with a smaller drive than I need and then replace that drive with one that has the capacity I do need.
    I was on the road a lot and used OneDrive as an additional backup means. Files in my OneDrive folder are set to “Always keep on this device.” I also use Macrium to backup files on my computers, so my OneDrive files also get backed up.
    I’ve also learned to periodically check my OneDrive folder settings as Microsoft has at times “helpfully” decided to change my settings, especially after getting feature updates. The giveaway is when the status symbols change on my folders,
    I now keep a laptop and a PC synchronized with each other using OneDrive. I’ve had one or two times when a file was inadvertently deleted, but I was able to recover it because it was still in OneDrive’s Recycle Bin if I notice it soon enough or still on the laptop which doesn’t get used as much (I don’t connect it to the internet immediately in this case) or in one of two backups (laptop and PC each get backed up on a regular basis).
    When advising family members about OneDrive and backups it can take some effort to get them to realize the pros and cons of relying on OneDrive.

    Reply
  2. I look at the on-demand files as links, not files because that’s what they are. They are shortcuts to the OneDrive server files that are downloaded to your computer or device when opened, copied, or specifically downloaded.
    I’m typing this on an older computer that has a 500GB drive. Most of the OneDrive files on this computer are on demand. Those files would be vulnerable because I’m traveling and my main computer is turned off so any changes I make to OneDrive files are not reflected on my main computer. Those files are protected because I do daily incremental backups.
    Don’t rely on OneDrive as a backup. Take regular full backups and daily incremental backups.

    Reply
  3. I think of OneDrive as temporary storage. It facilitates copying files from one computer to a remote computer (or vice-versa) but I don’t rely on it as a real storage device. If it’s not in OneDrive, then I know it’s backed up when I run my backup.

    Reply
  4. Windows 10 Lenovo Ideapad 320
    Hi
    I store all of my files on OneDrive as they exceed the capacity of the Ideapad hard drive. No files held on my Ideapad.
    However, if I disconnect the internet, I can stlll download files whose names appear on my Ideapad.
    Why is that occuring?
    Dave

    Reply

Leave a reply:

Before commenting please:

  • Read the article.
  • Comment on the article.
  • No personal information.
  • No spam.

Comments violating those rules will be removed. Comments that don't add value will be removed, including off-topic or content-free comments, or comments that look even a little bit like spam. All comments containing links and certain keywords will be moderated before publication.

I want comments to be valuable for everyone, including those who come later and take the time to read.