{"id":475,"date":"2011-10-02T19:52:33","date_gmt":"2011-10-03T00:52:33","guid":{"rendered":"http:\/\/blog.xfloyd.net\/?p=475"},"modified":"2011-10-02T19:55:29","modified_gmt":"2011-10-03T00:55:29","slug":"when-everything-goes-wrong-deja-dup","status":"publish","type":"post","link":"https:\/\/xfloyd.net\/blog\/?p=475","title":{"rendered":"When Everything Goes Wrong D\u00e9j\u00e0 Dup"},"content":{"rendered":"<p>D\u00e9j\u00e0 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 <a href=\"https:\/\/launchpad.net\/deja-dup\/+filebug\">filing a bug report<\/a>but in the meantime, here are some approaches to workaround a misbehaving D\u00e9j\u00e0 Dup and get your data back.<\/p>\n<p>This is going to get technical. If none of this makes sense to you, don&#8217;t be afraid to <a href=\"https:\/\/answers.launchpad.net\/deja-dup\">ask for help<\/a>.<\/p>\n<ol type=\"0\">\n<li>Open a Terminal window by pressing Ctrl+Alt+T.<\/li>\n<li>Create the directory in which you will place your restored files. This guide will use \/tmp\/restore:<\/li>\n<\/ol>\n<pre>mkdir -p \/tmp\/restore<\/pre>\n<p><!--more--><\/p>\n<h3 id=\"Restoring_with_Duplicity\">Restoring with Duplicity<\/h3>\n<p>On the assumption that D\u00e9j\u00e0 Dup is just not working for you right now, you&#8217;re going to use the command line tool duplicity that is used by D\u00e9j\u00e0 Dup behind the scenes to back up and restore your files.<\/p>\n<p>If you want more information about duplicity than presented here, run <tt>man\u00a0duplicity<\/tt>.<\/p>\n<p>The first thing we&#8217;ll try is a simple restore of all your data. Assuming your files are on an external drive mounted as \/media\/backup and you chose to encrypt the backup, try this:<\/p>\n<pre>duplicity --gio file:\/\/\/media\/backup \/tmp\/restore<\/pre>\n<p>If you didn&#8217;t encrypt the backup, add &#8211;no-encryption to the command.<\/p>\n<h3 id=\"Other_Backup_Locations\">Other Backup Locations<\/h3>\n<p>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. See below for how to connect to your chosen backup location.<\/p>\n<p>Remember to add &#8211;no-encryption to any example commands if you&#8217;re backup is not encrypted.<\/p>\n<p>If duplicity appears to be having trouble connecting to your server, try downloading all the duplicity files yourself to a local folder and following the simpler example above.<\/p>\n<h4 id=\"Amazon_S3\">Amazon S3<\/h4>\n<p>Look up your Amazon S3 access key ID and secret access key and replace instances of <strong>ID<\/strong> and <strong>SECRET<\/strong>in the example below with those respective values.<\/p>\n<p>You may have specified a folder in which to put the backup files. In the example below, replace any instance of <strong>FOLDER<\/strong>with that path.<\/p>\n<ol type=\"0\">\n<li>export AWS_ACCESS_KEY_ID=<strong>ID<\/strong><\/li>\n<li>export AWS_SECRET_ACCESS_KEY=<strong>SECRET<\/strong><\/li>\n<li>duplicity <tt>s3+http:\/\/<\/tt>deja-dup-auto-<strong>LOWERCASE_ID<\/strong>\/<strong>FOLDER<\/strong> \/tmp\/restore<\/li>\n<\/ol>\n<h4 id=\"Rackspace_Cloud_Files\">Rackspace Cloud Files<\/h4>\n<p>Look up your Rackspace username and API key and replace instances of <strong>USERNAME<\/strong> and <strong>KEY<\/strong>in the example below with those respective values.<\/p>\n<p>You may have specified a container in which to put the backup files. In the example below, replace any instance of <strong>CONTAINER<\/strong>with that name.<\/p>\n<ol type=\"0\">\n<li>export CLOUDFILES_USERNAME=<strong>USERNAME<\/strong><\/li>\n<li>export CLOUDFILES_APIKEY=<strong>KEY<\/strong><\/li>\n<li>duplicity <tt>cf+http:\/\/<\/tt><strong>CONTAINER<\/strong> \/tmp\/restore<\/li>\n<\/ol>\n<h4 id=\"FTP\">FTP<\/h4>\n<p>Look up your server address, port, username, and password and replace instances of <strong>SERVER<\/strong>, <strong>PORT<\/strong>, <strong>USERNAME<\/strong>, and <strong>PASSWORD<\/strong>in the example below with those respective values.<\/p>\n<p>You may have specified a folder in which to put the backup files. In the example below, replace any instance of <strong>FOLDER<\/strong>with that path.<\/p>\n<p>If you chose to not log in with a username, use anonymous as your <strong>USERNAME<\/strong>below.<\/p>\n<ol type=\"0\">\n<li>gvfs-mount <tt>ftp:\/\/<\/tt><strong>USERNAME<\/strong>@<strong>SERVER<\/strong>:<strong>PORT<\/strong>\/<strong>FOLDER<\/strong><\/li>\n<li>duplicity &#8211;gio <tt>ftp:\/\/<\/tt><strong>USERNAME<\/strong>@<strong>SERVER<\/strong>:<strong>PORT<\/strong>\/<strong>FOLDER<\/strong> \/tmp\/restore<\/li>\n<\/ol>\n<h4 id=\"SSH\">SSH<\/h4>\n<p>Look up your server address, port, username, and password and replace instances of <strong>SERVER<\/strong>, <strong>PORT<\/strong>, <strong>USERNAME<\/strong>, and <strong>PASSWORD<\/strong>in the example below with those respective values.<\/p>\n<p>You may have specified a folder in which to put the backup files. In the example below, replace any instance of <strong>FOLDER<\/strong>with that path.<\/p>\n<ol type=\"0\">\n<li>gvfs-mount <tt>ssh:\/\/<\/tt><strong>USERNAME<\/strong>@<strong>SERVER<\/strong>:<strong>PORT<\/strong>\/<strong>FOLDER<\/strong><\/li>\n<li>duplicity &#8211;gio <tt>ssh:\/\/<\/tt><strong>USERNAME<\/strong>@<strong>SERVER<\/strong>:<strong>PORT<\/strong>\/<strong>FOLDER<\/strong> \/tmp\/restore<\/li>\n<\/ol>\n<h4 id=\"WebDAV\">WebDAV<\/h4>\n<p>Look up your server address, port, username, and password and replace instances of <strong>SERVER<\/strong>, <strong>PORT<\/strong>, <strong>USERNAME<\/strong>, and <strong>PASSWORD<\/strong>in the example below with those respective values.<\/p>\n<p>You may have specified a folder in which to put the backup files. In the example below, replace any instance of <strong>FOLDER<\/strong>with that path.<\/p>\n<p>If you chose to use a secure connection (HTTPS) when backing up, use <tt>davs:\/\/<\/tt> instead of <tt>dav:\/\/<\/tt>in the example below.<\/p>\n<ol type=\"0\">\n<li>gvfs-mount <tt>dav:\/\/<\/tt><strong>USERNAME<\/strong>@<strong>SERVER<\/strong>:<strong>PORT<\/strong>\/<strong>FOLDER<\/strong><\/li>\n<li>duplicity &#8211;gio <tt>dav:\/\/<\/tt><strong>USERNAME<\/strong>@<strong>SERVER<\/strong>:<strong>PORT<\/strong>\/<strong>FOLDER<\/strong> \/tmp\/restore<\/li>\n<\/ol>\n<h4 id=\"Windows_Share\">Windows Share<\/h4>\n<p>Look up your server address, username, and password and replace instances of <strong>SERVER<\/strong>, <strong>USERNAME<\/strong>, and <strong>PASSWORD<\/strong>in the example below with those respective values.<\/p>\n<p>You may have specified a folder in which to put the backup files. In the example below, replace any instance of <strong>FOLDER<\/strong>with that path.<\/p>\n<p>If you specified a domain for your Windows server, add it to the beginning of <strong>USERNAME<\/strong> with a semicolon between them. For example, <em>domain;username<\/em>.<\/p>\n<ol type=\"0\">\n<li>gvfs-mount <tt>smb:\/\/<\/tt><strong>USERNAME<\/strong>@<strong>SERVER<\/strong>\/<strong>FOLDER<\/strong><\/li>\n<li>duplicity &#8211;gio <tt>smb:\/\/<\/tt><strong>USERNAME<\/strong>@<strong>SERVER<\/strong>\/<strong>FOLDER<\/strong> \/tmp\/restore<\/li>\n<\/ol>\n<h3 id=\"Restoring_by_Hand\">Restoring by Hand<\/h3>\n<p>If even duplicity isn&#8217;t working for you, there may be little hope. The backup file format is complicated and not easily manipulated. But if you&#8217;re desperate, it&#8217;s worth a try.<\/p>\n<p>If you used a remote or cloud server to store your backup, first download all the duplicity files and place them in a folder on your computer. Then enter that folder in your terminal.<\/p>\n<p>Duplicity stores your data in small chunks called volumes. Some volumes belong to the periodic &#8216;full&#8217; or fresh backups and others to the &#8216;inc&#8217; or incremental backups. Starting with a full backup set of volumes at volume 1, you&#8217;ll need to restore files volume by volume.<\/p>\n<p>If you encrypted your backup, first you must decrypt the volume with gpg. Say you have <em>duplicity-full.20110127T131352Z.vol1.difftar.gpg<\/em>:<\/p>\n<pre>gpg --output duplicity-full.20110127T131352Z.vol1.difftar --decrypt duplicity-full.20110127T131352Z.vol1.difftar.gpg<\/pre>\n<p>Or to do all at once (make sure you have plenty of space!):<\/p>\n<pre>gpg --multifile --decrypt duplicity-full.20110127T131352Z.*.difftar.gpg<\/pre>\n<p>Now you have either a <em>.difftar<\/em> or a <em>.difftar.gz<\/em>volume (depending on whether you had to decrypt it or not). Use tar on whichever one you have to extract the individual patch files:<\/p>\n<pre>tar xf duplicity-full.20110127T131352Z.vol1.difftar<\/pre>\n<p>Or again, to do all at once:<\/p>\n<pre>for t in duplicity-full.20110127T131352Z.*.difftar; do tar xf $t; done<\/pre>\n<p>Now the patch files will be in <em>multivolume_snapshot<\/em> and <em>snapshot<\/em> folders. Each file that spanned multiple volumes will be in <strong>multivolume_snapshot<\/strong>. Let&#8217;s say you backed up <tt>\/home\/jane\/essay.txt<\/tt>:<\/p>\n<pre>cd multivolume_snapshot\/home\/jane\/essay.txt\r\ncat * &gt; essay.txt<\/pre>\n<p>To recover data from incremental backups, use rdiff to stitch the files together. See <tt>man\u00a0rdiff<\/tt> for usage.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>D\u00e9j\u00e0 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 bug reportbut in the meantime, here are some approaches to workaround a misbehaving D\u00e9j\u00e0 Dup and get [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/475"}],"collection":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=475"}],"version-history":[{"count":4,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/475\/revisions"}],"predecessor-version":[{"id":480,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/475\/revisions\/480"}],"wp:attachment":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=475"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=475"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}