何をしても上手くいかない時
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.
以下は技術的な内容です。よく分からない場合は質問してみてください。
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.
まず、すべてのデータの単純な復元を試みてみましょう。バックアップファイルが /media/backup にマウントされた外付けドライブにあり、バックアップ時に暗号化することを選択したと仮定した場合、次のようにコマンドを実行します。
restic restore --repo=/media/backup --target=/tmp/restore latestバックアップを暗号化していない場合は、コマンドに --insecure-no-password オプションを追加します。
If you need to do more advanced debugging, read their troubleshooting guide.
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.
まず、すべてのデータの単純な復元を試みてみましょう。バックアップファイルが /media/backup にマウントされた外付けドライブにあり、バックアップ時に暗号化することを選択したと仮定した場合、次のようにコマンドを実行します。
duplicity restore file:///media/backup /tmp/restoreバックアップを暗号化していない場合は、コマンドに --no-encryption オプションを追加します。
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
duplicity すら動作しないのでは、おそらく望みは薄いでしょう。バックアップファイルのフォーマットは複雑で、簡単に操作することはできません。しかし、どうしても復元したいのであれば、手動での復元に挑戦してみるといいかもしれません。
リモートサーバーまたはクラウドサーバーをバックアップ先として使用していた場合は、まずあなたのコンピューター上のフォルダーに、すべての duplicity ファイルをダウンロードします。次に端末でそのフォルダーに移動します。
Duplicity はボリュームと呼ばれる小さなチャンクにデータを保存します。ボリュームは定期的に実行される「完全バックアップ」と、それ以外の「増分バックアップ」に分類されます。完全バックアップセットの最初のボリュームから順に、ボリュームごとにファイルを復元する必要があります。
バックアップする際に暗号化した場合は、先にボリュームを gpg コマンドで復号しなければなりません。例えば duplicity-full.20110127T131352Z.vol1.difftar.gpg というファイルの場合は以下のように実行します。
gpg --output duplicity-full.20110127T131352Z.vol1.difftar --decrypt duplicity-full.20110127T131352Z.vol1.difftar.gpg一度に複数のファイルを復号するには以下のように実行します (ドライブに十分な空き領域があることを確認してください)。
gpg --multifile --decrypt duplicity-full.20110127T131352Z.*.difftar.gpg上述の例のように復号した場合は .difftar、暗号化していなかった場合は .difftar.gz というファイルが手元にあるはずです。tar コマンドを使用して、それらのファイルを展開します。
tar xf duplicity-full.20110127T131352Z.vol1.difftar一度に複数のファイルを展開するには以下のように実行します。
for t in duplicity-full.20110127T131352Z.*.difftar; do tar xf $t; donemultivolume_snapshot フォルダーや snapshot フォルダーにデータが展開されるでしょう。複数のボリュームにまたがるファイルは multivolume_snapshot に展開されます。例えば /home/jane/essay.txt というファイルを結合するには、以下のように実行します。
cd multivolume_snapshot/home/jane/essay.txt
cat * > essay.txt増分バックアップからデータを復元するには、rdiff コマンドを使ってファイルを結合します。使用方法は man rdiff で確認してください。