<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-License-Identifier: CC-BY-SA-4.0
SPDX-FileCopyrightText: Michael Terry
-->
<page xmlns="http://projectmallard.org/1.0/" xmlns:its="http://www.w3.org/2005/11/its" its:version="2.0" type="topic" style="task" id="restore-worst-case" xml:lang="deja-dup-fi">
<info>
  <desc>Mitä tehdä, jos et voi palauttaa tiedostojasi</desc>
  <link type="guide" xref="index#restore"/>
  <credit type="author" its:translate="no">
    <name>Michael Terry</name>
  </credit>
  <license href="http://creativecommons.org/licenses/by-sa/4.0/"><p>Creative Commons Attribution-Share Alike 4.0 Unported License</p></license>

    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>Aleksi Kinnunen</mal:name>
      <mal:email>https://launchpad.net/~aleksi-kinnunen</mal:email>
      <mal:years/>
    </mal:credit>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>Jiri Grönroos</mal:name>
      <mal:email>https://launchpad.net/~jiri-gronroos</mal:email>
      <mal:years/>
    </mal:credit>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>Jussi Aalto</mal:name>
      <mal:email>https://launchpad.net/~jtaalto-deactivatedaccount</mal:email>
      <mal:years/>
    </mal:credit>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>Masa</mal:name>
      <mal:email>https://launchpad.net/~masa-diskotek</mal:email>
      <mal:years/>
    </mal:credit>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>Sami Jaktholm</mal:name>
      <mal:email>https://launchpad.net/~sjakthol</mal:email>
      <mal:years/>
    </mal:credit>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>T Kortehisto</mal:name>
      <mal:email>https://launchpad.net/~kortehisto</mal:email>
      <mal:years/>
    </mal:credit>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>Timo Jyrinki</mal:name>
      <mal:email>https://launchpad.net/~timo-jyrinki</mal:email>
      <mal:years/>
    </mal:credit>
  </info>

<title>Kun kaikki menee pieleen</title>

<p><app>Déjà Dup</app> 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 <link href="https://gitlab.gnome.org/World/deja-dup/-/issues/new">help request</link> but in the meantime, here are some approaches to workaround a misbehaving <app>Déjà Dup</app> and get your data back.</p>

<note><p>Nämä ohjeet ovat hyvin teknisiä. Jos et ymmärrä näitä ohjeita, älä pelkää <link xref="support">pyytää apua</link>.</p></note>

<steps>
  <item><p>Avaa <app>Pääte</app> pikanäppäinyhdistelmällä <keyseq><key>Ctrl</key><key>Alt</key><key>T</key></keyseq>.</p></item>
  <item><p>Luo kansio, johon palautetut tiedostot asetetaan. Tämä opas käyttää kansiota <file its:translate="no">/tmp/restore</file>:</p>
<screen its:translate="no">mkdir -p /tmp/restore</screen></item>
</steps>

<section id="duplicity">
<title>Palautus Duplicityn avulla</title>

<p>Jos oletetaan, että <app>Déjà Dup</app> ei toimi juuri nyt, kokeillaan <app>duplicity</app>-nimisen komentorivityökalun käyttöä. <app>Duplicity</app> hoitaa <app>Déjà Dupin</app> kulissien takana kaikki varmuuskopioinnit ja palautukset.</p>

<note style="advanced"><p>Jos haluat enemmän tietoa <app>duplicity</app>sta kuin mitä tässä esitellään, kirjoita päätteeseen <cmd>man duplicity</cmd>.</p></note>

<p>Yritetään aluksi yksinkertaista keinoa palauttaa kaikki tiedostot. Oletetaan, että tiedostot ovat salatulla ulkoisella levyasemalla, joka on liitetty polkuun <file its:translate="no">/media/backup</file>. Kokeile seuraavaa:</p>
<screen its:translate="no">duplicity --gio file:///media/backup /tmp/restore</screen>

<p>Jos et salannut varmuuskopiota, lisää <cmd its:translate="no">--no-encryption</cmd> komentoon.</p>

<section id="locations">
<title>Muut varmuuskopiointisijainnit</title>
<p>Jos varmuuskopiot sijaitsevat pilvipalvelussa tai etäpalvelimella, <app>duplicityn</app> komento eroaa yllä olevasta ulkoisen kiintolevyn esimerkistä. Alla kerrotaan tavoista, joilla voit yhdistää valitsemaasi etäpalvelimeen tai pilvipalveluun.</p>
<note><p>Muista lisätä <cmd its:translate="no">--no-encryption</cmd> kaikkiin esimerkkikomentoihin, jos varmuuskopiosi ei ole salattu.</p></note>
<p>Jos <app>duplicity</app> ei saa yhteyttä palvelimeen, lataa kaikki <app>duplicityn</app> tiedostot paikalliseen kansioon ja käytä yllä olevaa ulkoiselta kiintolevyltä palauttamisen esimerkkiä tiedostojen palauttamiseen.</p>
<terms>
  <item>
    <title>FTP</title>
    <p>Look up your server address, port, username, and password and replace instances of <var>SERVER</var>, <var>PORT</var>, <var>USERNAME</var>, and <var>PASSWORD</var> in the example below with those respective values.</p>
    <p>You may have specified a folder in which to put the backup files.  In the example below, replace any instance of <var>FOLDER</var> with that path.</p>
    <p>If you chose to not log in with a username, use <var its:translate="no">anonymous</var> as your <var>USERNAME</var> below.</p>
    <screen its:translate="no">
gvfs-mount ftp://<var its:translate="yes">KÄYTTÄJÄTUNNUS</var>@<var its:translate="yes">PALVELIN</var>:<var its:translate="yes">PORTTI</var>/<var its:translate="yes">KANSIO</var>
duplicity --gio ftp://<var its:translate="yes">KÄYTTÄJÄTUNNUS</var>@<var its:translate="yes">PALVELIN</var>:<var its:translate="yes">PORTTI</var>/<var its:translate="yes">KANSIO</var> /tmp/restore</screen>
  </item>
  <item>
    <title>SSH</title>
    <p>Look up your server address, port, username, and password and replace instances of <var>SERVER</var>, <var>PORT</var>, <var>USERNAME</var>, and <var>PASSWORD</var> in the example below with those respective values.</p>
    <p>You may have specified a folder in which to put the backup files.  In the example below, replace any instance of <var>FOLDER</var> with that path.</p>
    <screen its:translate="no">
gvfs-mount ssh://<var its:translate="yes">KÄYTTÄJÄTUNNUS</var>@<var its:translate="yes">PALVELIN</var>:<var its:translate="yes">PORTTI</var>/<var its:translate="yes">KANSIO</var>
duplicity --gio ssh://<var its:translate="yes">KÄYTTÄJÄTUNNUS</var>@<var its:translate="yes">PALVELIN</var>:<var its:translate="yes">PORTTI</var>/<var its:translate="yes">KANSIO</var> /tmp/restore</screen>
  </item>
  <item>
    <title>WebDAV</title>
    <p>Look up your server address, port, username, and password and replace instances of <var>SERVER</var>, <var>PORT</var>, <var>USERNAME</var>, and <var>PASSWORD</var> in the example below with those respective values.</p>
    <p>You may have specified a folder in which to put the backup files.  In the example below, replace any instance of <var>FOLDER</var> with that path.</p>
    <p>If you chose to use a secure connection (HTTPS) when backing up, use <var its:translate="no">davs://</var> instead of <var its:translate="no">dav://</var> in the example below.</p>
    <screen its:translate="no">
gvfs-mount dav://<var its:translate="yes">KÄYTTÄJÄTUNNUS</var>@<var its:translate="yes">PALVELIN</var>:<var its:translate="yes">PORTTI</var>/<var its:translate="yes">KANSIO</var>
duplicity --gio dav://<var its:translate="yes">KÄYTTÄJÄTUNNUS</var>@<var its:translate="yes">PALVELIN</var>:<var its:translate="yes">PORTTI</var>/<var its:translate="yes">KANSIO</var> /tmp/restore</screen>
  </item>
  <item>
    <title>Windows-jako</title>
    <p>Look up your server address, username, and password and replace instances of <var>SERVER</var>, <var>USERNAME</var>, and <var>PASSWORD</var> in the example below with those respective values.</p>
    <p>You may have specified a folder in which to put the backup files.  In the example below, replace any instance of <var>FOLDER</var> with that path.</p>
    <p>If you specified a domain for your Windows server, add it to the beginning of <var>USERNAME</var> with a semicolon between them.  For example, <var>domain;username</var>.</p>
    <screen its:translate="no">
gvfs-mount smb://<var its:translate="yes">KÄYTTÄJÄTUNNUS</var>@<var its:translate="yes">PALVELIN</var>/<var its:translate="yes">KANSIO</var>
duplicity --gio smb://<var its:translate="yes">KÄYTTÄJÄTUNNUS</var>@<var its:translate="yes">PALVELIN</var>/<var its:translate="yes">KANSIO</var> /tmp/restore</screen>
  </item>
</terms>
</section>

</section>

<section id="by-hand">
<title>Palautus käsin</title>

<p>If even <app>duplicity</app> isn’t working for you, there may be little hope.  The backup file format is complicated and not easily manipulated.  But if you’re desperate, it’s worth a try.</p>

<p>If you used a remote or cloud server to store your backup, first download all the <app>duplicity</app> files and place them in a folder on your computer.  Then enter that folder in your terminal.</p>

<p><app>Duplicity</app> stores your data in small chunks called volumes.  Some volumes belong to the periodic ‘full’ or fresh backups and others to the ‘inc’ or incremental backups.  Starting with a full backup set of volumes at volume 1, you’ll need to restore files volume by volume.</p>

<p>If you encrypted your backup, first you must decrypt the volume with <cmd its:translate="no">gpg</cmd>.  Say you have <file its:translate="no">duplicity-full.20110127T131352Z.vol1.difftar.gpg</file>:</p>
<screen its:translate="no">gpg --output duplicity-full.20110127T131352Z.vol1.difftar --decrypt duplicity-full.20110127T131352Z.vol1.difftar.gpg</screen>

<p>Or to do all at once (make sure you have plenty of space!):</p>
<screen its:translate="no">gpg --multifile --decrypt duplicity-full.20110127T131352Z.*.difftar.gpg</screen>

<p>Now you have either a <file its:translate="no">.difftar</file> or a <file its:translate="no">.difftar.gz</file> volume (depending on whether you had to decrypt it or not).  Use <cmd its:translate="no">tar</cmd> on whichever one you have to extract the individual patch files:</p>
<screen its:translate="no">tar xf duplicity-full.20110127T131352Z.vol1.difftar</screen>

<p>Or again, to do all at once:</p>
<screen its:translate="no">for t in duplicity-full.20110127T131352Z.*.difftar; do tar xf $t; done</screen>

<p>Now the patch files will be in <file its:translate="no">multivolume_snapshot</file> and <file its:translate="no">snapshot</file> folders.  Each file that spanned multiple volumes will be in <file its:translate="no">multivolume_snapshot</file>. Let’s say you backed up <file its:translate="no">/home/jane/essay.txt</file>:</p>
<screen its:translate="no">cd multivolume_snapshot/home/jane/essay.txt
cat * &gt; essay.txt</screen>

<p>To recover data from incremental backups, use <cmd its:translate="no">rdiff</cmd> to stitch the files together. See <cmd its:translate="no">man rdiff</cmd> for usage.</p>

</section>

</page>
