Quan falla tot

Déjà Dup may fail. Maybe it crashes or gives you an error when you try to restore. When you really need your data back, the last thing you want do deal with is a bug. Consider filing a help request but in the meantime, here are some approaches to workaround a misbehaving Déjà Dup and get your data back.

La cosa es posarà tècnica. Si no enteneu res, no tingueu por de demanar ajuda.

These instructions assume you have a command line available. Open a Terminal window first.

Restic or Duplicity?

Over time, Déjà Dup has used different backup tools under the covers. Originally, it used Duplicity. Nowadays, it uses Restic.

Your backup might be in either format, depending on when you created it.

Look in the folder where your backup is kept:

  • If the filenames all start with duplicity-, then it's a Duplicity backup. Read the Duplicity sections below.

  • If you see a config file and a few folders like keys, then it's a Restic backup. Read the Restic sections below.

Restoring with Restic

On the assumption that Déjà Dup is just not working for you right now, let’s use the command line tool Restic that is used by Déjà Dup behind the scenes to back up and restore your files.

If you want more information about Restic than presented here, run restic --help.

El primer que intentarem és una simple restauració de totes les dades. Suposant que els fitxers es troben en una unitat externa muntada com a /media/backup i heu triat xifrar la còpia de seguretat, proveu:

restic restore --repo=/media/backup --target=/tmp/restore latest

Si no heu xifrat la còpia de seguretat , afegiu--insecure-no-password a la comanda.

If you need to do more advanced debugging, read their troubleshooting guide.

Restauració amb Duplicity

On the assumption that Déjà Dup is just not working for you right now, let’s use the command line tool duplicity that is used by Déjà Dup behind the scenes to back up and restore your files.

If you want more information about Duplicity than presented here, read its online documentation.

El primer que intentarem és una simple restauració de totes les dades. Suposant que els fitxers es troben en una unitat externa muntada com a /media/backup i heu triat xifrar la còpia de seguretat, proveu:

duplicity restore file:///media/backup /tmp/restore

Si no heu xifrat la còpia de seguretat , afegiu--no-encryption a la comanda.

Other Storage Locations

If you backed up to a remote or cloud server, the syntax you use with Duplicity will be different than the external drive example above.

Read the Duplicity documentation for instructions on how to connect to your server, or try downloading all the Duplicity files yourself to a local folder and following the simpler example above.

Restoring Duplicity Files by Hand

Si duplicity encara no funciona, pot haver-hi una mica d'esperança. El format del fitxer de còpia de seguretat és complicat i no es manipula fàcilment. Però si esteu desesperats, val la pena provar-ho.

Si heu utilitzat un servidor remot o al núvol per emmagatzemar la vostra còpia de seguretat, primer descarregueu tots els fitxers de duplicity i col·loqueu-los en una carpeta del vostre ordinador. A continuació, introduïu aquesta carpeta al vostre terminal.

Duplicity emmagatzema les dades en petits fragments anomenats volums. Alguns volums pertanyen a les còpies de seguretat periòdiques "completes" o noves, i altres a les còpies de seguretat "inc" o incrementals. Començant amb una còpia de seguretat completa dels volums al volum 1, haureu de restaurar els fitxers volum per volum.

Si heu xifrat la vostra còpia de seguretat, primer heu de desxifrar el volum amb gpg. Digues que tens duplicity-full.20110127T131352Z.vol1.difftar.gpg:

gpg --output duplicity-full.20110127T131352Z.vol1.difftar --decrypt duplicity-full.20110127T131352Z.vol1.difftar.gpg

O feu-ho tot alhora (assegureu-vos de tenir molt espai):

gpg --multifile --decrypt duplicity-full.20110127T131352Z.*.difftar.gpg

Ara teniu o bé .difftar o un .difftar.gz volum (segons si l'heu de desxifrar o no). Utilitzeu tar en qualsevol que hagueu d'extreure els fragments de fitxer:

tar xf duplicity-full.20110127T131352Z.vol1.difftar

O de nou, per fer-ho tot alhora:

for t in duplicity-full.20110127T131352Z.*.difftar; do tar xf $t; done

Ara, els fragments del fitxer estaran a les carpetes multivolume_snapshot i snapshot. Cada fitxer que abasti diversos volums estarà a multivolume_snapshot. Diguem que heu fet una còpia de seguretat /home/jane/essay.txt:

cd multivolume_snapshot/home/jane/essay.txt
cat * > essay.txt

Per recuperar dades de còpies de seguretat incrementals, feu servir rdiff per unir els fitxers. Vegeu man rdiffper al seu ús.