When importing my last backup I get the following error message:
Error reading …/xxx-2021-12-22-15-15-45.gramps
not well-formed (invalid token: line 1, column 2
The file is either corrupt or not a valid Gramps database
OK, nice. Does this mean that the backup file itself is not .gramps but .gpkg (or whatever a backup with media is called)? I always make backups without, so I’m not sure.
You can do a lot on the command line if you change the file’s extension to .gz, and then use gunzip on it. This will then create an uncompressed something, and I write something, because for a backup without media, it will simpy create an uncompressed .gramps file, that you can rename to .xml and open with a text editor to see what’s inside.
I don’t know what you’ll get when you run gunzip on a renamed backup with media though, so it may be easier to open it within the file manager, and let the graphical archive tool do the dirty work. That’s up to you.
After that, you can use the file command to check the formats of the extracted files. And when I believe what @emyoulation wrote earlier, a backup with media may contain a .gramps file that is still compressed, meaning that you’d need to repeat the rename and gunzip procedure on that. And that’s why the file command is so useful for this.
Chances are that when you (finally) have the uncompressed .gramps renamed to .xml, Linux will try to open it with Firefox, and that is not a very good idea. You can better open it with the text editor instead to see how it looks.
I’m running LMDE 5 here. What Mint version are you on?
The .gramps file is a compressed file (.gz) of the actual backup file with the same name. I am on windows so use a program like 8 Zip Pro to extract the actual backup.
The backup is actually an XML file (even though it has the extension .gramps) so any text editor will open it.
My first line is <?xml version="1.0" encoding="UTF-8"?>
OK, I understand. I just ran a test with my setup, and it’s quite a mess, so @emyoulation is quite right with this comment:
Anyway, to navigate this fine mess, your best bet is to rename the original .gpkg to .gz and open that inside Nemo. It will then automatically open the archive manager, called Archiefbeheer here (I’m in The Netherlands). And when you use that, you’ll see another .gpkg file inside, which you can extract. You could also use gunzip for that, but using the GUI is often easier to see what you’re doing.
Now the file command reveals that this .gpkg file is actually a TAR file, so you need to do another rename to .tar, and open that with the archive manager again. And this will finally reveal a list of all the files in this archive (TAR means Tape ARchive!), from which you only need to extract the data.gramps file. You will also recognize your media, but I assume that you have those already. If not, extract all files.
The file command revealed that this data.gramps is again a compressed file, so the story repeats itself with a rename to data.gz and running the archive manager, or gunzip, to reveal a genuine uncompressed data.gramps, which should contain XML text, and look like what @DaveSch wrote.
There is a chance that you won’t get this far, because the archive itself has been corrupted.
And this time, life on Windows would be a lot easier, because on that you can let 7-Zip do all the work.
To tell you the truth, I don’t think it’s a failure, because Gramps should be able to read a backup that it creates, with or without media. I prefer backups without, because they’re faster, and I back up my media in other ways, and they are easier to import, but they should work anyway.
This suggests that your .gpkg file is corrupted, so you may need to be careful anyway.