# GRAMPS-XML repair a backup

**URL:** <https://gramps.discourse.group/t/gramps-xml-repair-a-backup/2620>\
**Category:** Help\
**Created:** [July 20, 2022, 11:13am UTC](https://gramps.discourse.group/t/gramps-xml-repair-a-backup/2620 "2022-07-20T11:13:49Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![ennoborg](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/ennoborg/32/4659_2.png) [@ennoborg](https://gramps.discourse.group/u/ennoborg)\
**Post date:** [July 20, 2022, 4:00pm UTC](https://gramps.discourse.group/t/gramps-xml-repair-a-backup/2620/7 "2022-07-20T16:00:29Z")

</div>

> [@zabranah](#):
>
> Doing the export you got the joice to do an “Gramps-XML Paket (Stammbaum und Medien)”-Export. Thats what I’ve done.

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:

> [@Writing ZIPless (uncompressed XML) .gramps files and defaulting to .gpkg archives](https://gramps.discourse.group/t/writing-zipless-uncompressed-xml-gramps-files-and-defaulting-to-gpkg-archives/2616):
>
> Could the Export functions for Gramps XML formats be streamlined? Say that a .gramps file started only exporting as plain text XML. If compression is selected, writing XML would then force a change to the .gpkg format file extension? (Perhaps the .gpkg format should be the default?) Also, the Gramps XML files added inside a .gpkg archive also forcing to uncompressed .gramps XML files, then the inefficiencies of recursive ZIPping are minimized. The current exported .gramps file format can be Z…

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.

---

_[View the full topic](https://gramps.discourse.group/t/gramps-xml-repair-a-backup/2620)._
