1

Reformatted computer and when I try to sync my fresh install with my back-up tomboy notes I get a synchronization error. When I click details the panel is empty. I have 100's of notes, some of which are critical so I really need this fixed.

My back-up directory structure may be corrupted as a result of several failed syncs. It goes something like this:

tomboy notes / 0 
               |-0
               | |-0
               |-1
               |-2
               |-3
               |-4
               |-etc.

The numbers continue to 22. In each directory there's at least 1 .note file and a manifest.xml file.

Also, if this structure is messed-up beyond repair, is there some way to recover the data manually? Or perhaps to port it into some other note-taking program and then port it back?

1

All these folders contain your notes, but one certain note may have different versions. So usually the folder number zero contains the largest number of notes (initial versions), and higher numbered folders contain more recent versions (the bigger folder number corresponds to the more recent version).

I suppose that for correct automatic restore someone also need a copy of ~/.config/tomboy/ directory, or at least a manifest.xml from that place (also see the directory structure here).

On restore, if you decide that you don't need the entire history, but just the most recent versions of every note, you can extract those with the following python code:

import os
from collections import defaultdict
from shutil import copy2 as copy

input_dir = 'your/backup/dir/'
output_dir = '~/.local/share/tomboy/'
notes = defaultdict(list)
for root, dirs, files in os.walk(input_dir):
    for f in files:
        if f.endswith('.note'):
            notes[f] += [root]
print("Total number of notes: %d" % len(notes))
for k,v in notes.items():
    newest_version = os.path.join(sorted(v, reverse=True)[0], k)
    copy(os.path.join(input_dir, newest_version), output_dir)

Hope this will help somebody.

P.S. Sync model is partly covered here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.