Sean's Musings as a Service

Sean's Musings as a Service

Recovering my old Gramps db

  • Published:
  • categories: software
  • tags: gramps, upgrade, geneaology

Found an old copy of my family tree that I started a few years ago now, probably back in 2008. Oddly enough I was just getting back into looking at this again this year, so I wanted to merge the two and following the advice on the forums I started a new Family Tree and started trying to import my old one first:

The Database version is not supported by this version of Gramps.You should use an old copy of Gramps at version 3.0.x and import your database into that version. You should then export a copy of your data to Gramps XML (Family Tree). Then you should upgrade to the latest version of Gramps (for example this version), create a new empty database and import the Gramps XML into that version. Please refer to:http://www.gramps-project.org/wiki/index.php?title=Gramps_3.4_Wiki_Manual_-_Manage_Family_Trees#Moving_a_Gramps_2.2_databases_to_Gramps_3.x

So evidently my old file into my current Gramps client, so I need to go back to the drawing board. So this is a pretty old version and no longer in any of my package repositories for OS X, CentOS, or Ubuntu, so I started at the Gramps wiki for building from source to figure out the dependencies. They provide a helpful starter command to get your machine ready. So I started by bringing up a Lubuntu 13.04 vmimage to play with, now getting the basics ready following the instructions from gramps’ wiki first:

sudo apt-get install -y python python-gtk2 librsvg2-common libglib2.0-dev intltool xdg-utils rcs python-gtkspell python-webkit python-pygoocanvas graphviz python-pyexiv2 libosmgpsmap-dev python-osmgpsmap gtk2-engines-pixbuf
sudo apt-get install -y build-essential

Then I downloaded the source and *.deb file from sourceforge:

$ cd ~/Downloads
$ tar xvzf gramps_3.0.4.tar.gz
$ cd gramps-3.0.4
$ ./configure
...
$ make
...
$ sudo make install
...

So no I tried first with the source file and got an error:

3384: ERROR: gramps.py: line 215: Gramps failed to start.
Traceback (most recent call last):
  File "/usr/share/gramps/gramps.py", line 193, in run
    gramps_main.Gramps(args)
  File "/usr/share/gramps/gramps_main.py", line 234, in __init__
    self.vm = ViewManager.ViewManager(state)
  File "/usr/share/gramps/ViewManager.py", line 224, in __init__
    self.__build_main_window()
  File "/usr/share/gramps/ViewManager.py", line 270, in __build_main_window
    self.uimanager, self.progress_monitor, self)
  File "/usr/share/gramps/DisplayState.py", line 324, in __init__
    self.last_bar = self.status.insert(min_width=15, ralign=True)
  File "/usr/share/gramps/GrampsWidgets.py", line 1216, in insert
    label.set_alignment(xalign=1.0, yalign=0.5)
AttributeError: 'gtk.HBox' object has no attribute 'set_alignment'

Thought I may have goofed things up, so I switched to the deb package.

$ cd ~/Downloads/gramps-3.0.4
$ sudo make uninstall
...
$ cd ..
$ sudo dpkg -i gramps_3.0.4-1_Ubuntu810.deb
...

But that ended with the same result, scratched my head a bit, having been pretty sure that would have solved it, got me thinking this is more a version issue ? A bit more trolling through problems on the internets, and evidently logs of folks had this issue back in 2009 and 2010 when this was a somewhat current version. Stumbled across and enterprising chap who posted to bugs.debian.org with the same issue, and he just dove right in there and changed the code, just to see what would happen, hmmm… interesting idea, I think I can do that.

sgwilbur@ubuntu:/usr/share/gramps$ sudo cp GrampsWidgets.py GrampsWidgets.py.orig
sgwilbur@ubuntu:/usr/share/gramps$ sudo vim GrampsWidgets.py 
sgwilbur@ubuntu:/usr/share/gramps$ diff GrampsWidgets.py GrampsWidgets.py.orig 
1216c1216
<             #label.set_alignment(xalign=1.0, yalign=0.5)        
---
>             label.set_alignment(xalign=1.0, yalign=0.5)        
sgwilbur@ubuntu:/usr/share/gramps$ 

And sure as shit, it starts up fine after that wtf? Ok but unfortunately not the end of my woes, now I can open the client but it fails to import the old family tree…. So a bit more searching and find that the file only works with the corresponding ~/.gramps files and should be in the same location owned by the same users, double eff! That machine is long gone and I don’t know where I had it stored or what my stupid username was back in 2006 on whatever random windows/linux/bsd machine I was using at the time, but there is a final last ditch hail-mary. The Gramps wiki has some ways to deal with corruption of the db, well that could explain what is going on here. Before I go down into the weeds and start digging through the BSD DB I decided to just try earlier versions of Gramps, turns out I was a few years off, I was just 2.0.x of Gramps which is a totally different version, sure would have been nice if the Gramps devs had just put a dang version identifier for the schema version but that might be a bit much for a project started almost 10 years ago, overall I am able to export it out to various formats and will give them a try to see what works best.

Moral of the story is that 3h later, I have my old Gramps db resurrected and merged with my new one, w00t w00t!

Was just starting to dig into bsddb and the update pybsddb3 opening up the file to root around in there too…

Reference: