As I mentioned in a previous post, I am in the process of "Going Paperless." I have decided to use Evernote as my digital repository. (I love the tags!!) One important requirement of my new information repository system is that there has to be a way to back up my data. Unfortunately, Evernote does not include a built-in backup option; however, there is a command line utility to export notes. Since I am semi-dangerous with scripting, I decided to write a batch file to create a consistent and automatic backup system.
The script does the following:
- Checks the registry to make sure Evernote is installed
- Gets the Evernote installation path from the registry
- Create a folder based on the day and time
- Enumerates the notebooks
- Separately exports each notebook
- Compresses each export
- Adds a note to each notebook with a status of the export
The exportNotes
command exports notes based on a query into a new notebook. This means that if all notebooks are exported in one shot, the notebook organization is lost. By exporting one notebook at a time, the notebook structure can be recovered as well as the notes. So, if something catastrophic where to happen, time is not wasted reorganizing thousands of notes.
To make the backup happen automatically, I use the Windows Task Scheduler to run the script every day at 1800R.
Please let me know if you find this information useful or have any suggestions on how to improve it.
Thanks for sharing the script. One thought: Evernote’s export feature has certain limits. From https://help.evernote.com/hc/en-us/articles/209005557 “The “Created” and “Modified” dates of each note are not preserved. Instead, these dates reflect the date and time when the note was imported.” and “Stacks and note links are unique to your account and can’t exist outside of your account. This means that you’ll have to re-create these after you’ve imported your notes back into your account.”
There are some other subtle aspects to backup/restore that are fully discussed in this fine community post which I highly recommend.
https://discussion.evernote.com/topic/86152-backing-up-and-restoring-evernote-data-reference-article/#comment-390503
Thanks for sharing John! There just is not a perfect method. Hopefully, they will add a “true” backup option at some point. It seems that there is a lot of interest in such.
Hi there,
Is it also possible to use this script to overwrite the exisiting folders?
Because the way I see it works now, is that a new folder containing all the (duplicate) information as well.
Look forward to your reply!
Hi, Job.
The script is mainly to show how I implemented the automation of Evernote export. This could be part of a DR scenario, as an example.
You can modify the script to remove older folders, or you can create a new script that runs in the scheduled task after the export to remove the older folders. I prefer to keep the duplicates so I have a history or in case a note gets changed and I do not immediately realize something is wrong. Then at some point, I do remove really old exports, keeping monthly, quarterly, and annual exports.