Hi Gerhard,

For something else, I experimented one addon [1][2].
It is not properly documented and is not available for production.

Better to look at differences under Gramps 4.0.x !
Once you have a list of differences, you can try to check and merge XML records.

The alternate way is maybe to make diff between your backup and your thrashed database.

$ gunzip < data.gramps > data.xml
$ gunzip < backup.gramps > backup.xml
$ diff -u backup.xml data.xml > diff.patch

You can try to generate a new 'merged' .gramps file, then to import its content into a new database.

PS: if I remember well, there is a workaround which can avoid "handles check" on import. This works fine for a simple table (eg, events, people, places, sources, citations). ie. you can import 100 000 individuals or citations (collection), then to attach them to your records! Unfortunately, having some cross-references (links between tables) will impose such a check on import. 

Hope this could help.


[1] http://svn.code.sf.net/p/gramps-addons/code/branches/gramps34/contrib/lxml/bck.gpr.py
[2] http://svn.code.sf.net/p/gramps-addons/code/branches/gramps34/contrib/lxml/bck.py
maybe needs also:
[3] http://svn.code.sf.net/p/gramps-addons/code/branches/gramps34/contrib/lxml/diff.py
[4] http://svn.code.sf.net/p/gramps-addons/code/branches/gramps34/contrib/lxml/dictionary.py

Le dim. 27 avril 2014 at 22:59, Gerhard Killesreiter <gerhard@killesreiter.de> a écrit :
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi there, I am in the unfortunate situation that my main database got thrashed in some way. Luckily, I have a not too ancient backup (mid-March) and a very recent XML export of the most recent data. The XML export does not cover the whole database, though. The idea is now to restore the backup (easy) and then import the XML export. This is where the problems start. The XML import creates new people, events, places, etc.... I would prefer if it could overwrite the existing objects in the gramps DB. I've looked into the code, and found in gramps/plugins/importer/importxml.py # Data with handles already present in the db will overwrite existing # data, so all imported data gets a new handle. This behavior is not # needed and even unwanted if data is imported in an empty family tree # because NarWeb urls are based on handles. Also for debugging purposes # it can be advantageous to preserve the orginal handle. self.replace_import_handle = (self.db.get_number_of_people() > 0 and not LOG.isEnabledFor(logging.DEBUG)) So, I tried to start gramps as 'gramps --debug=""' and I got a lot of debug output, but when I imported the XML file, I still had duplicates. Can anybody help me resolve this? Merging the duplicates maunually is not an option as there are about 4k people and 10k events... Cheers, Gerhard -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iEYEARECAAYFAlNdb64ACgkQfg6TFvELooTh3ACgqMHQUXDLz5DDQ8Q2DN5ESYKk XN0AoJs5J4Ojzbma6/89MZ9334sPEGEf =25DF -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform _______________________________________________ Gramps-users mailing list Gramps-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gramps-users