Difference between revisions of "Comment je récupère mon arbre familial"

From Gramps
Jump to: navigation, search
Line 13: Line 13:
  
 
==Que dois je faire maintenant ?==
 
==Que dois je faire maintenant ?==
The answer depends on whether or not you have the environment for that database. If you just copied one file into another then the environment still may work. If you modified the original database since then, then the original environment has chanegd and there's no good environment for the new file. If you removed your <code>.gramps</code> directory (why oh why?) then all environments are lost. So act depending on the situation, as explained below.
+
La réponse dépend de la présence ou non de l'environment de votre base de données. Si vous avez simplement copié un fichier vers un autre alors l'environnement devrait toujours fonctionner. Si vous avez modifié votre base de données depuis, alors l'environnement original a changé, il n'y a pas de bon environnement pour votre nouvelle base. Si vous avez déplacé votre répertoire <code>.gramps</code> (pourquoi oh pourquoi ?) alors les environnements seront perdus. Agissez ainsi en fonction de la situation, comme il est expliqué ci-dessous.
  
 
===L'environnement existe toujours===
 
===L'environnement existe toujours===

Revision as of 13:41, 23 October 2007


Une tentative pour expliquer une corruption de GRDB, comment récupérer sa base, et comment l'éviter dans le futur.

Pourquoi cette corruption?

De loin, la principale cause d'une corruption du fichier grdb est le déplacement de ce dernier de son emplacement original. Que vous déplaciez le fichier vers un autre répertoire, le renommer, le copier, que vous le transférez vers une autre machine, ou un autre compte utilisateur -- toutes ces actions vont "corrompre" votre fichier.

Ce qui arrive c'est que le fichier grdb a besoin de son environnement de base de données -- un répertoire avec ses fichiers log, fichiers verrous, fichiers temporaires, etc. Les derniers versions stables conserve l'environnement pour chaque fichier, suivant un arbre hierarchique du répertoire ~/.gramps/env. Si votre fichier grdb est sous /home/utilisateur/généalogie/MesDonnées.grdb alors son environnement est dans le répertoire /home/utilisateur/.gramps/env/home/utilisateur/généalogie/MesDonnées.grdb.

Ainsi, le déplacement, la copie ou le renommage du fichier copiera ses bytes, mais pas son environnement. C'est pourquoi le fichier déplacé apparaît comme corrompu.

Que dois je faire maintenant ?

La réponse dépend de la présence ou non de l'environment de votre base de données. Si vous avez simplement copié un fichier vers un autre alors l'environnement devrait toujours fonctionner. Si vous avez modifié votre base de données depuis, alors l'environnement original a changé, il n'y a pas de bon environnement pour votre nouvelle base. Si vous avez déplacé votre répertoire .gramps (pourquoi oh pourquoi ?) alors les environnements seront perdus. Agissez ainsi en fonction de la situation, comme il est expliqué ci-dessous.

L'environnement existe toujours

If you have environment directory for that file, copy it under the above gudelines.

Example
You copied /home/user/genealogy/MyData.grdb to /home/user/genealogy/backup/BackupData.grdb and the new file is not working.
Solution
Copy /home/user/.gramps/env/home/user/genealogy/MyData.grdb directory into /home/user/.gramps/env/home/user/genealogy/backup/BackupData.grdb and this should fix the problem.

L'environnement est perdu

If you don't have the original environment for that file, you may try dumping and loading your data using Berkeley DB tools. Depending on your system, they may be called db_dump and db_load, db41_dump and db41_load, db4.4_dump and db4.4_load, or some such. Whatever they are called, there should be be a dump tool and a load tool, and they should be version 4 or later.

Basically, you just dump the grdb into a text file, then create a new grdb from that text file:

   $ db4.4_dump BackupData.grdb > somefile.txt
   $ db4.4_load newfile.grdb < somefile.txt

and then cross your heart and hope that newfile.grdb will open in gramps.

Comment prévenir ce type de corruption ?

While moving the file is the leading cause of corruption, apparently there are other less frequent causes that we don't fully know. So preventing corruption is not always possible.

What is possible though is to backup the data regularly. The backups should be in XML format (the .gramps format). XML is machine- and human-readable. It is completely self-sufficient. It is also smalll. Following are the good practices of backups:

  1. Export to XML from time to time, especially after large edits.
  2. Export to XML before making big changes, such as importing new data into an existing database from e.g. GEDCOM; merging records; running tools that may heavily modify the data etc.
  3. Export to XML before upgrading gramps to a newer version. Apparently, export to XML with old version before you install the new one!
  4. Export to XML before upgrading your OS.

Also, use XML format for any data migration. Moving to another machine, sending data to grandma, copying to another user on the same machine -- all of these cases should use XML.

Quelqu'un pourrait corriger ce problème ?

Oui c'est possible ! Dans la prochaine version (GRAMPS 3.0/4.0) cette partie sera complétement réécrite, voir ici.