(Disclaimer: I am not advocating any changes. I just want to figure out how important it would be to spend time trying to figure out how to get Sleepycat BSDDB3 working in the flatpak again. Also I know there are run-on sentences.)
Python-bsddb3 was supported up to python 3.6, but actually worked in the flatpak until python version 3.9. It stopped working with python version 3.10 in the flatpak. However, I saw that Canonical seems to be patching python-bsddb3 to work with Sleepycat BSDDB3 with current python versions past python 3.9. However, what I saw at launchpad is that their debian source is in tar. I could only find the Canonical patched python-bsddb3 in .deb format. Before trying to find a way to extract something useful out of the patched .deb inside the flatpak manifest, I wanted to verify that Canonical’s patched python-bsddb3 actually works with the python 3.13 available for the flatpak. Otherwise I could be wasting time if it doesn’t actually work. (For user safety, flathub will not allow me to use pip to import files, or for me to extract the deb myself and upload it. Every dependency has to be individually declared in the manifest with full transparency on source and compiling commands for github to compile the flatpak. So I have to figure out how to automate github extracting the useful patches out of the deb file from launchpad unless I find a tar or git from a reputable site with the Canonical patches.)
So for tests I made three tests with my oldest backups (2012 gpkg, 2019 gpkg, and a .gramps perhaps from 2016.
- Fedora-compiled flatpak with bsddb3 and python 3.14 included on a Fedora 42 VM: my backups opened ok, but in preferences I can not select bsddb3. (Prerequisites checker shows bsddb3 installed)
- Snap Gramps 6.0.8 with bsddb3 and python 3.12 included on a Ubuntu 24.04 VM: my backups opened ok, but in preferences I can not select bsddb3. (Prerequisites checker shows bsddb3 installed)
- Flathub flatpak of Gramps 6.0.7 with python 3.13 but without bsddb3 on Fedora 43: my backups opened ok, but in preferences I can not select bsddb3. (Prerequisites checker shows bsddb3 not installed)
So with ChatGPT guidance I looked at my backups in cli and found that the gpkg files did not include any databases. They seem to be in XML format. When Gramps restores these backups now, I found they get restored with a SQLite backend regardless of the original backend or whether BSDDB3 is actually installed.
So in what situation does BSDDB3 actually need to be included to prevent user data loss, instead of being an option for the user?
- My gpkg from 2012 can be opened with the Gramps 6.0.7 flatpak from Flathub without BSDDB3 included. So restoring old gpkg and gramps backups should not need BSDDB3, correct?
- Now for current databases that are still on BSDDB3, isn’t there a workaround as follows if something happened? If the directory with the BSDDB3 database got an .old added to the end of the directory name, and the backup .gramps file that by default gets generated when Gramps exits got double-clicked from the file browser, wouldn’t Gramps regenerate the database with whatever backend is available?
- If a user saved an old Gramps directory instead of the backup, is there a workaround to recover the data? Perhaps a cli tool? Perhaps a helper application could be written to convert BSDDB3 directories to a gpkg or gramps backup, and made available at the gramps-project website?
- Is there an archived testing BSDDB3 database for Gramps available to verify that Canonical’s patch actually works? Apparently a configuration file has to be found and edited with a text editor to allow BSDDB3 to show up as a database option in Gramps preferences? So I would need to either find and edit that file in the Fedora flatpak and Canonical snap just to verify that python-bsddb3 still works, or obtain a directory that still has a BSDDB3 database?