Gramps data migration tool

A user just posted a question about recovering their Tree after a computer OS being crashed. They had mounted the corrupted OS boot drive as an external drive & wanted to restore the Gramps data to a fresh computer.

It seemed like this might be a task we all will have to do sooner or later.

Could there be a tool built for this specific purpose?

To move the data, they needed to:

  • Identify the version of Gramps
  • Identify the database backend
  • Locate the database files
  • Locate the backups (decide if the backups are current)
  • Locate the media files
  • Transfer copies of the appropriate files to the new system
  • Restore the ALL the Trees in the database old folder to the database version in the fresh install of Gramps
  • Make current backups

The gramp.ini file has a lot of this information. So a tool that sought out copies of that file & parsed all discovered copies might be able to do most of the location tasks.

However, I noticed that the .ini file does not include some important info for migrating data. Like the version of Gramps, the database engine version, the volumeID for drive letters (or a some sort of relative offset for the path for the gramps.ini with respect to the backup, database & media paths).

There are additional niceties such a tool could do:

  • Install the same dependecies
  • Install the same add-ons
  • Restore preferences (main & add-on)
  • Restore report options
  • Restore holiday calendars
  • Restore report options
  • Restore custom filters
  • Restore books
  • Restore localization
1 Like

I wonder if some of the Gramps script list options couldnt be adapted to this purpose?

If a database path could be specified (which temporarily overrides the gramps.ini path) then the
gramps -L
and
gramps -l
might list the Trees and identify versions with statistics?

If I temporarily set the gramps.ini database path to such an external drive, would these tools work?

Or would Gramps choke if the database files are from a different version? Would it try to update them to the current version and potentially corrupt them?

Could I (somehow) automatically script Gramps to look in a database path & export all the Trees to .gpkg files?