How to merge two versions of RedNotebook

Asked by Nick Clay

Due to not thinking through the effects of the closure of the Ubuntu One cloud service in June, I've ended up with two versions of my journal, one on my local UbuntuOne folder, with no entries for a period I was away from home, the other, containing entries for much of August and September and done in a different physical location (which I won't be able to revisit for some time), on Dropbox. (This second version was originally saved and synched on Ubuntu one, but the service had of course finished before I arrived there, so I had only the files in the local UbuntuOne folder and those only up to March, when I was last there.) When I left I saved that version, containing the additional new entries for while I'd been there, to a new folder on Dropbox. Since being home I've continued, for safety, with the version on my local UbuntuOne folder. I now want to integrate the two, preferably on to Dropbox. Clearly I could copy and paste individual entries, but I'm wondering if there's a simpler, and more comprehensive, way of merging two journals. For example, while working away from home in August and September I did some occasional minor editing to several much earlier entries, which I'd like to preserve if possible in the unified version. If I do a 'Save as' of my local (UnuntuOne folder) version to the Dropbox folder, presumably I risk overwriting those edits, or even possibly overwriting entries written in the other location with blank entries from here! I'd be grateful for advice as to the best/safest way to proceed. (And yes, I have backed up both versions!)

Question information

Language:
English Edit question
Status:
Solved
For:
RedNotebook Edit question
Assignee:
No assignee Edit question
Solved by:
Nick Clay
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Jendrik Seipp (jendrikseipp) said :
#1

Unfortunately, there is no easy way of merging two journals. I would
recommend opening both journals simultaneously and then moving over the
content. It is save to have multiple RedNotebook instances open, just
not the same journals.

Revision history for this message
Nick Clay (nickdclay) said :
#2

Thanks. I've copied and pasted for the easy ones, where there was an entry in one version and no entry in the other. Eventually I might try using something like Meld to examine the saved monthly text files in the two different journal folders, find the ones that are different because of later edits and merge them to a new location. Presumably that would work and be safe?

Revision history for this message
Jendrik Seipp (jendrikseipp) said :
#3

It's quite easy to mess up the YAML markup that is used in the month
files, but RedNotebook will issue a warning when it sees such a file and
you can fix it.

Revision history for this message
Nick Clay (nickdclay) said :
#4

Thanks Jendrik Seipp, that solved my question.

Revision history for this message
Nick Clay (nickdclay) said :
#5

First, apologies that I never came back to thank you for your last comment.

I'm now back at the away-from-home pc and trying to amalgamate my two journal versions. I thought I had it cracked until I discovered the truth of your last comment: "It's quite easy to mess up the YAML markup that is used in the month
files!" I thought I had been meticulous in copying and pasting, but RedNotebook doesn't like the result:

2014-11-25 10:46:47,891 ERROR Error in file Dropbox/Personal/RedNotebook/2014-10.txt:
while parsing a flow mapping
  in "Dropbox/Personal/RedNotebook/2014-10.txt", line 1, column 4
did not find expected ',' or '}'
  in "Dropbox/Personal/RedNotebook/2014-10.txt", line 10, column 34

I don't know how to correlate lines and columns as identified by RedNotebook with either Leafpad or Gedit, which are the two text editors I've been using. Furthermore, in creating 2014-10.txt I had a file containing entries for the 17th onwards, so I simply copied and pasted the first 16 days' entries across from the other version's file. I made no other changes. Yet when I scrutinised the file for missing ' and } I found quite a few. Although I have no knowledge of YAML, the basic pattern for opening and closing entries using {' and '} when one inspects a whole month's file seems fairly straightforward. I anticipated that having supplied the missing closing ' and } in one or two places I would either have a successful opening of RedNotebook, or else a different set of error identifications. But in fact I got exactly the same error message as quoted above.

Can you explain where I may be going wrong and how I can, as you said previously, "fix it"?

Revision history for this message
Jendrik Seipp (jendrikseipp) said :
#6

I'm sorry, fixing this is a pain. The easiest way is to remove all
content from the file excpet for one day and then iteratively adding
content back until loading the file breaks. Then you will have to fix
the day that broke the file. Obviously, you can also try adding multiple
days at once until you include a day that is malformatted. Good luck :)

Revision history for this message
Nick Clay (nickdclay) said :
#7

Thanks! I tried one day at a time and got the same error for the very first day; I then tried some later days, but got the same error again. I was about to grit my teeth and begin copying every entry for October from the non-loading text file back into an open RN, when I remembered Dropbox keeps version histories. I found a version of the corrupted October file from early November, before I left home, and once I'd restored it to the RN folder, all was back together again. Phew! It's worth noting perhaps that if I hadn't been saving to a location that preserves version history I'd have been stymied. Lessons learned: back up regularly and if you work across different locations and computers make sure your default save folder location keeps file version histories.

Thanks again for your help.

Revision history for this message
sh (sharnish) said :
#8

This ruins it for me. Suddenly lost 3 months of journal witn very important medical information recorded faithfully every day. I'm disgusted that I trusted this amateur and his buggy program. If anybody knows a decent journal applicatio where my data doesn't suddenly disappear forever, please post it here. Thank you.

Revision history for this message
Jendrik Seipp (jendrikseipp) said :
#9

I would recommend doing a system-wide search for files 2015-05.txt etc.