Why is it possible to edit OneNote notebooks in the cloud without an active Internet connection? Does this mean that there are local notebooks in all versions of OneNote? Yes and No. Learn some basics about the cache and editing notes offline.
As you probably already know, OneNote lets you read and edit notes without an active internet connection, as long as the notebook has been opened before, when you had a connection. This gets often confused with locally stored notebooks being held on every OneNote client and platform. In fact, there is a sort of local copy, but it’s very different from a duplicate of the notebook files on OneDrive or OneDrive for Business. Let me explain.
OneNote’s file handling is very different from Word, Excel or other Windows programs, which explains some peculiarities. If the following appears too detailed for you, simply jump down to the “Summary” section at the end of the article.
OneNote’s special file handling
Most users assume, that OneNote acts like every other windows program: load a data file (a document or notebook in this case) from a storage device (hard drive, cloud storage…) to the computers or mobile device’s RAM, where you edit its content and then save it back to the storage location, overwriting the previous version. But this is not what OneNote does. This is what happens instead:
At first OneNote actually does load the note data from the disk or from the cloud (I won’t discuss the exact file format in this article as that’s not relevant here). This always happens when you open a notebook that hasn’t been opened before and as such has not been listed in the notebook navigation.
But instead of holding the note data in RAM memory to let you modify it, something else is happening right after the loading / downloading: OneNote immediately converts this data into a different and very special binary format. Simply put, all objects contained in the note pages (images, files, text paragraphs…) are stored as individual files or records in a hidden location on the local device (e.g. the PC hard disk or the internal smartphone or tablet flash memory). This highly fragmented copy of the data is the so-called notebook cache. It’s not only stored to the device but also replaces the previously loaded notebook files in RAM. The actual notebook files on OneDrive or your computer (OneNote Win 32 for Windows only) remain untouched; all editing is done in the cache version in memory only and every change automatically saved to the cache data files (but not to the actual notebook yet).
That’s the reason why no active internet connection is needed at this point. As long as there is that locally stored cache version (again: not to be confused with a local copy of the actual notebook files, because the cache is in a completely different format), you can completely work offline even if the actual notebook files are stored on OneDrive. You can edit, add and delete notes, whole pages, even sections. What you can’t do is create new notebooks in the cloud. This needs to be done at the original storage location first, before a local cache copy is created. Also you can’t open notebooks from OneDrive while offline, of course.
In order to update the “real” notebook files, an internal OneNote synchronization mechanism compares the changes from the cache files with the actual notebook files. Of course, if the notebooks are in the cloud, this only happens when an Internet connection is (re)established. Well, thinking of it, I might have been wrong here. Because after editing anything in your notes OneNote tries to start a synchronization even when offline, this must work a bit different. OneNote obviously knows that a sync is needed without being able to compare the note content to the cloud files. I assume, every edit sets a flag in the cache files so the sync mechanism knows that changes might have occured and an update is needed. Or something similar 🙂
Interesting fact: The same mechanism including the separation of cache and notebook files also applies to notebooks that are stored locally or a network folder, which is only possible with the “full” Windows-Office-version of OneNote.
I have tried to illustrate the process in the image at the beginning of the article.
It should also correct a common misunderstanding that OneNote clients (like OneNote for iPhone, Android, Web, Windows, Mac) are syncing notebooks to each other. They don’t. Each OneNote synchronizes it’s own local cache files against the files on OneDrive. So those are the “reference version” that all OneNote clients need to access to be up to date.
The sync mechanism is based on a special protocol called COBALT or MS-FSSHTTP which is related to the protocol that is used by Sharepoint. It is built into the OneNote client and does not make use of the local OneDrive app on your device. In fact, it would perfectly work, if OneDrive wasn’t installed on your computer or mobile device at all. Yes, you can see a representation of OneNote notebooks in your local OneDrive sync folder. But they are only placeholders (links to the actual notebooks on OneDrive). They do not contain any notebook data nor are they part of the sync process.
Other file cloud services such as Dropbox, Google Drive or Box do not support COBALT, so OneNote notebooks cannot be synchronized with these services (although that seems to work by placing locally stored notebooks in the Dropbox- or Google-Drive-sync-folder). More about this in this older but still valid article.
Because the sync mechanism is part of OneNote and not of the operating system (e.g. as a service in Windows), notebooks are only synchronized while OneNote is running.
Why so cumbersome?
But why can’t OneNote handle notebook files just as easily (load, edit, save) as Word or other Windows programs?
There are mainly two reasons for this:
The first is the (temporary) offline availability of notebooks. To be able to edit your notebooks stored in the cloud (or on a LAN server) even without any network connection, you need a full copy on the local device. That’s why OneNote, after opening a notebook, immediately mirrors its contents locally. That method is the reason why large notebooks can take quite long to open; its complete content has to be downloaded first. Once downloaded, you can quickly navigate through all notes, because the local cache is used. If OneNote would download only currently accessed content, navigating through pages and sections would be a pain, because everything would get downloaded on demand. Also, offline work would be impossible.
The second reason has to do with the option to concurrently edit notes from different devices or by several users. Conventional PC file systems simply do not allow this. Once an application has opened a data file, that file gets locked for editing by other applications or computers. Some applications refuse to open a locked file, while others (Excel for example) at least allow read-only access. The file locking is only removed by saving and closing the file from the editing application. This mechanism is part of the operating system; no application, including OneNote, is able to avoid it. But because in OneNote every user / device has it’s own local cache copy, file locking is not a concern.
As I mentioned before, the files in the local OneNote cache are much more fragmented than the original copy. It consists of many, many small files. There is a reason for this too:
In OneNote, several users can edit not only the same notebook at a time but also the same section or even page. This is possible because every object (text paragraph, image, printout, embedded file…) on a note page is stored in a separate cache file. On the server side (e.g. on OneDrive) a similar fragmentation takes place. So only changed objects (cache files) are transferred during synchronization. The server is reconstructing the page by collecting those fragments and putting them together like pieces of a puzzle. It does not matter if those puzzle pieces are provided by different devices or users.
So while concurrent edits of the same page are possible because of this system, there is also a restriction: If two or more users (or you on different devices) edit the same object, this mechanism will fail. The object (e.g. a text paragraph) is the smallest individual unit. So when two versions of the same object (puzzle piece) arrive at the server, OneNote cannot solve the conflict. In this case, the synchronization service helps itself by creating a copy of the affected page. It also warns the user that there is a conflict that cannot be resolved. It leaves the task to manually merge the edits (or choose the correct version) to the user.
The biggest advantage of the protocol and the fragmentation technique, apart from teamwork or multi-device use: Only changed objects are transmitted over the network which means speed, lower use of bandwidth and data contingent.
Can the cache be used as a backup or offline notebook?
So obviously a local copy of every opened notebook does exist. Can this be used as a notebook backup to store it away on an external disk or thumb drive? Sorry, but the answer is No. Even if you were able to locate and access the cache files (which can be only be done on OneNote 2010/2013/2016 for Windows without serious hacking) and copy it away, that data is of no use. It could not be restored at a later time, because there are still some additional indexes and registry entries in play. It just won’t work.
And what about (mis)using the locally cached data as an offline-only notebook? Generally, this is possible but I would not recommend it. Yes, you could create an empty notebook on OneDrive (at least for this a cloud connection is needed), sync it to your device and thus create a local cache copy. Then you could delete the notebook from OneDrive and just keep it open on your device to just work with the cache copy. The content will never get synced to OneDrive because the target notebook does not even exist. You’d get constant sync error messages instead which you could ignore.
But this is a dangerous game: The local cache is somewhat fragile. It can easily be erased once and for all by resetting the app, maybe during a future update of the app or even just by closing the notebook. I would not recommend it.
Summary (tl;dr)
The above information in a nutshell:
- When opening a notebook, OneNote loads the corresponding files from the disk or from the cloud, but does not work with them directly, as Word or other programs do.
- Instead, it immediately creates a copy of all content on the local device, called the cache. This also applies to smartphones or tablets.
- The cache copy is in a completely different format than the original files. All notes are fragmented into small portions. Each “fragment” represents an object, such as a paragraph of text or an image.
- These cache files are not usable, for example as a notebook backup. They are also rather fragile.
- OneNote will work exclusively with this cache copy; all changes are made here, not to the actual notebook files.
- An independent sync mechanism on the client (integrated in OneNote) and server (e.g. OneDrive) collects changed and uploaded cache fragments to create updated notebook files. This can be done from multiple devices or users at the same time.
“What you can’t do is create new notebooks in the cloud”…
As for October 2018, this is not true… You can create Notebooks online (and you have already been able to create notebooks from within your One Drive for a long time…)
Thanks for this Blog post as it clearly states that Chris Pratley and his team have been genius’ with their invention !
And I am really looking forward to the new sync engine that makes real-time collaboration possible…
You clearly misunderstood me (may be because of my lousy English :)). i was explaining what you can and can’t do while your device is offline. I doubt you could create a notebook using the web browser on OneDrive while not connected to the internet 🙂
Hi Stefan, if the cache folder is taking up several GB’s of space, is it safe to delete the .bin files? there are over 10,000 .bin files in my cache folder eating up valuable free space on my SSD, the last modified date on these files go from recent to all the way back to when I first started using OneNote 2016 on this particular Win10 computer. Or is there a way to manually trigger a sync to clear these files? I don’t use OneDrive but I do use workbooks from network shares
Hi Yaskar. Sorry, I read your question so late. In case you are still expecting an answer:
Usually cache files should be erased automatically whenever you close the corresponding notebook. There may be reasons that this does not always work as intended, so the cache files are left behind.
To be on the safe side I’d try the following:
Close all notebooks in OneDrive
Close OneNote and try to move the remaining bin files (or better: the complete cache folder content) to a different place. Alternatively you could alter the cache storage location in the OneNote options but I tend to stay away from that setting.
Start OneNote, open the notebooks that you need and see if they are ok, maybe change or add some text and let it sync (yes, even for locally or on a network share stored notebooks that syncing happens, although maybe too fast to notice).
If all seems ok, it should be safe to erase the moved bin files (those you moved in step 2).
In addition (I’m the careful type), before doing all this I would export at least the most important notebooks as a ONEPKG file and store that away. Never a bad idea, just in case…
What is the sync interval of notebooks with cache?
So is there a data recovery tool or something that can be used to recover notebooks from the cache?
My scenario: Was using OneNote2016 with a local notebook. Later our company got GSuite, so I moved the notebook onto the Google Drive to share/sync with a laptop. Later still, GSuite temporarily broke so I was just using the local cache (did not realise how dangerous that was at the time). Still later, GSuite was restored, but all contents on the Drive had been cleared.
OneNote now happily sync’d the EMPTY drive over the top of my local data, removing everything except for the Section I was currently viewing. To say I’m not happy is an understatement… MS Support has been unable to assist.
I did find the cache files, and it seems that most of the Content is still there, just not accessible (I’ve since also taken a backup of them just in case). Surely there must be some way to duplicate what the OneNote server does and recombine the cache files into notebook data?!
If anybody knows of such a tool, or perhaps the data format for the cache, please let me know!
We had a similar issue, and found that copying the cache to another machine exactly allowed the cache to be opened and read. However, the only viable method of exporting the data was manual copy-pastes into a new, working notebook.
could I store onenote on my owncloud in my home. rather store it on onedrive cloud?
Thanks for the informative article. How did you create the visio type graphics for this article?
No kidding: I used Visio 🙂
Awesome, Thanks 🙂
Hi there!
I was wondering if there is a way to delete OneNote on my MacBook, but still keep the files in OneDrive?
Yes. Just make sure, all noteboooks have been synced (no exclamation marks or warnings in the app). This is important! You may also check on http://www.onedrive.com to see if all notes are accessible in the browser version of OneNote. Then close the notebooks in the app on the Mac. After that it’s safe to erase the app.
I’m working with my ipad and my laptop on notes. The backup version on my desktop is kept even after closing the notebook. This is exactly what I prefer, because I do not like to use internet explorer in the 365 version, also, opening the online version, requires the download of all pages (takes a long time with many pages). Now I’m setting up windows 10-tiles to access my notes quickly from the start screen.
Question: Which file can I run to tell windows to open the backup version on my desktop in the Notes explorer?
does anybody know where are the offline files located of onenote for windows 10, I need to find them as I have been working ofline since a long time
This is great piece of information… It would be great if you can shed some light on using a VPN such as Ivacy for personal and professional use. Is it a good idea?
Great article! OneNote has become a central part of my workflow.
Thank you very much for your detailed expanation about how sync works in one note.
Finally I feel that now it is safe to work on my files on different computers, in different countries, and on and off-line 😉
Thanks for the informative article. Do you know what happens to a word or excel file you insert into note page? Let’s say you have a note page template that contains Word and Excel documents. What happens to these Excel and Word documents when the template is copied? Are new filenames created? Are these files also stored in the cache folder?