How can I restore a folder backed up on my old computer running Ubuntu to my new one?












0















To my surprise and delight I was able to do this. I figured I should document it somewhere. It synthesizes a couple other answers I found to guide me but focuses on a case that I haven't seen addressed directly.



This is my situation: a couple years ago I replaced my home computer. My old computer was running Ubuntu 14. My new one is running Ubuntu 16. On the old computer, I was making regular backups to an external drive using backups/deja-dup/duplicity.



A couple days ago, the hard drive on my old computer (Ubuntu 14 one) died. I had copied over most the important stuff to my new computer (Ubuntu 16). However, there was a projects folder that still had some older projects that I hadn't gotten around to copying over. So I wanted to see if I could restore this folder from the backups on the external drive.



This is the path of the folder from my old computer I wanted to restore:




  • /home/klenwell/projects


This is the path of the folder on my external drive where the backups were being saved (after plugging external drive into new computer):




  • /media/klenwell/my-external-drive/u2014


I wanted to restore it to a folder at this path on my new computer:




  • /tmp/restored/u2014/projects










share|improve this question



























    0















    To my surprise and delight I was able to do this. I figured I should document it somewhere. It synthesizes a couple other answers I found to guide me but focuses on a case that I haven't seen addressed directly.



    This is my situation: a couple years ago I replaced my home computer. My old computer was running Ubuntu 14. My new one is running Ubuntu 16. On the old computer, I was making regular backups to an external drive using backups/deja-dup/duplicity.



    A couple days ago, the hard drive on my old computer (Ubuntu 14 one) died. I had copied over most the important stuff to my new computer (Ubuntu 16). However, there was a projects folder that still had some older projects that I hadn't gotten around to copying over. So I wanted to see if I could restore this folder from the backups on the external drive.



    This is the path of the folder from my old computer I wanted to restore:




    • /home/klenwell/projects


    This is the path of the folder on my external drive where the backups were being saved (after plugging external drive into new computer):




    • /media/klenwell/my-external-drive/u2014


    I wanted to restore it to a folder at this path on my new computer:




    • /tmp/restored/u2014/projects










    share|improve this question

























      0












      0








      0








      To my surprise and delight I was able to do this. I figured I should document it somewhere. It synthesizes a couple other answers I found to guide me but focuses on a case that I haven't seen addressed directly.



      This is my situation: a couple years ago I replaced my home computer. My old computer was running Ubuntu 14. My new one is running Ubuntu 16. On the old computer, I was making regular backups to an external drive using backups/deja-dup/duplicity.



      A couple days ago, the hard drive on my old computer (Ubuntu 14 one) died. I had copied over most the important stuff to my new computer (Ubuntu 16). However, there was a projects folder that still had some older projects that I hadn't gotten around to copying over. So I wanted to see if I could restore this folder from the backups on the external drive.



      This is the path of the folder from my old computer I wanted to restore:




      • /home/klenwell/projects


      This is the path of the folder on my external drive where the backups were being saved (after plugging external drive into new computer):




      • /media/klenwell/my-external-drive/u2014


      I wanted to restore it to a folder at this path on my new computer:




      • /tmp/restored/u2014/projects










      share|improve this question














      To my surprise and delight I was able to do this. I figured I should document it somewhere. It synthesizes a couple other answers I found to guide me but focuses on a case that I haven't seen addressed directly.



      This is my situation: a couple years ago I replaced my home computer. My old computer was running Ubuntu 14. My new one is running Ubuntu 16. On the old computer, I was making regular backups to an external drive using backups/deja-dup/duplicity.



      A couple days ago, the hard drive on my old computer (Ubuntu 14 one) died. I had copied over most the important stuff to my new computer (Ubuntu 16). However, there was a projects folder that still had some older projects that I hadn't gotten around to copying over. So I wanted to see if I could restore this folder from the backups on the external drive.



      This is the path of the folder from my old computer I wanted to restore:




      • /home/klenwell/projects


      This is the path of the folder on my external drive where the backups were being saved (after plugging external drive into new computer):




      • /media/klenwell/my-external-drive/u2014


      I wanted to restore it to a folder at this path on my new computer:




      • /tmp/restored/u2014/projects







      backup deja-dup duplicity






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 hours ago









      klenwellklenwell

      1,49431925




      1,49431925






















          1 Answer
          1






          active

          oldest

          votes


















          0














          First, a quick refresher from question above on the key paths I'll be working with here:




          • Folder from old dead computer I want to restore: /home/klenwell/projects

          • Folder of old computer backups on external drive (when plugged into new computer): /media/klenwell/my-external-drive/u2014

          • Folder on new computer where I want restore folder: /tmp/restored/u2014/projects


          Command Line



          From command line, here at the command I ran to restore the backup. See the next section for a step-by-step guide with explanation:



          # backup new project directory (to be safe)
          mkdir /tmp/new-projects-backup
          cp -R ~/projects /tmp/new-projects-backup

          # review list of backed up paths from old computer
          sudo duplicity list-current-files file:///media/klenwell/my-external-drive/u2014 > /tmp/u2014-backup-list.txt
          less /tmp/u2014-backup-list.txt

          # make destination folder for restored directory
          mkdir /tmp/restored/u2014/projects

          # restore backup
          sudo duplicity restore
          --file-to-restore home/klenwell/projects
          file:///media/klenwell/my-external-drive/u2014
          /tmp/restored/u2014/projects

          # confirm folder has been restored
          ls -al /tmp/restored/u2014/projects


          Step-By-Step Guide



          Here's a break down of the commands below with explanations for each command:





          1. Plug in external drive to new computer and confirm it's accessible:



            ls -al /media/klenwell


            Notes:




            • In reality, the mounted external drive's directory name a random string like ksdfd987s-0sll1332-skd09233.

            • To simplify this guide, I will assume it was named my-external-drive and backups were in folder u2014.




          2. Confirm I can see backed up files from older computer:



            sudo duplicity list-current-files file:///media/klenwell/my-external-drive/u2014 > /tmp/u2014-backup-list.txt
            less /tmp/u2014-backup-list.txt


            Notes:




            • I needed to use sudo to deal with this import error: https://lists.nongnu.org/archive/html/duplicity-talk/2013-10/msg00002.html

            • I needed to know the password I used to encrypt backups on my old computer meaning I entered 2 password: my sudo password and my backups password.

            • Note the file:// prefix for my backups folder path.

            • It took a few minutes to generate the output file.




          3. Back up /home/klenwell/projects on my new computer just to be safe in case duplicity tries to restore the backup folder to same path for some strange reason:



            mkdir /tmp/new-projects-backup
            cp -R ~/projects /tmp/new-projects-backup



          4. Here's where the magic happens (it was a somewhat large directory so it took a few minutes in my case):



            sudo duplicity restore 
            --file-to-restore home/klenwell/projects
            file:///media/klenwell/my-external-drive/u2014
            /tmp/restored/u2014/projects



          5. And to confirm all went well, I should now see my old project directory restored:



            ls -al /tmp/restored/u2014/projects



          References




          • https://askubuntu.com/a/332914

          • Extract a Folder from Duplicity Archive

          • https://lists.nongnu.org/archive/html/duplicity-talk/2013-10/msg00002.html






          share|improve this answer

























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1128178%2fhow-can-i-restore-a-folder-backed-up-on-my-old-computer-running-ubuntu-to-my-new%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            First, a quick refresher from question above on the key paths I'll be working with here:




            • Folder from old dead computer I want to restore: /home/klenwell/projects

            • Folder of old computer backups on external drive (when plugged into new computer): /media/klenwell/my-external-drive/u2014

            • Folder on new computer where I want restore folder: /tmp/restored/u2014/projects


            Command Line



            From command line, here at the command I ran to restore the backup. See the next section for a step-by-step guide with explanation:



            # backup new project directory (to be safe)
            mkdir /tmp/new-projects-backup
            cp -R ~/projects /tmp/new-projects-backup

            # review list of backed up paths from old computer
            sudo duplicity list-current-files file:///media/klenwell/my-external-drive/u2014 > /tmp/u2014-backup-list.txt
            less /tmp/u2014-backup-list.txt

            # make destination folder for restored directory
            mkdir /tmp/restored/u2014/projects

            # restore backup
            sudo duplicity restore
            --file-to-restore home/klenwell/projects
            file:///media/klenwell/my-external-drive/u2014
            /tmp/restored/u2014/projects

            # confirm folder has been restored
            ls -al /tmp/restored/u2014/projects


            Step-By-Step Guide



            Here's a break down of the commands below with explanations for each command:





            1. Plug in external drive to new computer and confirm it's accessible:



              ls -al /media/klenwell


              Notes:




              • In reality, the mounted external drive's directory name a random string like ksdfd987s-0sll1332-skd09233.

              • To simplify this guide, I will assume it was named my-external-drive and backups were in folder u2014.




            2. Confirm I can see backed up files from older computer:



              sudo duplicity list-current-files file:///media/klenwell/my-external-drive/u2014 > /tmp/u2014-backup-list.txt
              less /tmp/u2014-backup-list.txt


              Notes:




              • I needed to use sudo to deal with this import error: https://lists.nongnu.org/archive/html/duplicity-talk/2013-10/msg00002.html

              • I needed to know the password I used to encrypt backups on my old computer meaning I entered 2 password: my sudo password and my backups password.

              • Note the file:// prefix for my backups folder path.

              • It took a few minutes to generate the output file.




            3. Back up /home/klenwell/projects on my new computer just to be safe in case duplicity tries to restore the backup folder to same path for some strange reason:



              mkdir /tmp/new-projects-backup
              cp -R ~/projects /tmp/new-projects-backup



            4. Here's where the magic happens (it was a somewhat large directory so it took a few minutes in my case):



              sudo duplicity restore 
              --file-to-restore home/klenwell/projects
              file:///media/klenwell/my-external-drive/u2014
              /tmp/restored/u2014/projects



            5. And to confirm all went well, I should now see my old project directory restored:



              ls -al /tmp/restored/u2014/projects



            References




            • https://askubuntu.com/a/332914

            • Extract a Folder from Duplicity Archive

            • https://lists.nongnu.org/archive/html/duplicity-talk/2013-10/msg00002.html






            share|improve this answer






























              0














              First, a quick refresher from question above on the key paths I'll be working with here:




              • Folder from old dead computer I want to restore: /home/klenwell/projects

              • Folder of old computer backups on external drive (when plugged into new computer): /media/klenwell/my-external-drive/u2014

              • Folder on new computer where I want restore folder: /tmp/restored/u2014/projects


              Command Line



              From command line, here at the command I ran to restore the backup. See the next section for a step-by-step guide with explanation:



              # backup new project directory (to be safe)
              mkdir /tmp/new-projects-backup
              cp -R ~/projects /tmp/new-projects-backup

              # review list of backed up paths from old computer
              sudo duplicity list-current-files file:///media/klenwell/my-external-drive/u2014 > /tmp/u2014-backup-list.txt
              less /tmp/u2014-backup-list.txt

              # make destination folder for restored directory
              mkdir /tmp/restored/u2014/projects

              # restore backup
              sudo duplicity restore
              --file-to-restore home/klenwell/projects
              file:///media/klenwell/my-external-drive/u2014
              /tmp/restored/u2014/projects

              # confirm folder has been restored
              ls -al /tmp/restored/u2014/projects


              Step-By-Step Guide



              Here's a break down of the commands below with explanations for each command:





              1. Plug in external drive to new computer and confirm it's accessible:



                ls -al /media/klenwell


                Notes:




                • In reality, the mounted external drive's directory name a random string like ksdfd987s-0sll1332-skd09233.

                • To simplify this guide, I will assume it was named my-external-drive and backups were in folder u2014.




              2. Confirm I can see backed up files from older computer:



                sudo duplicity list-current-files file:///media/klenwell/my-external-drive/u2014 > /tmp/u2014-backup-list.txt
                less /tmp/u2014-backup-list.txt


                Notes:




                • I needed to use sudo to deal with this import error: https://lists.nongnu.org/archive/html/duplicity-talk/2013-10/msg00002.html

                • I needed to know the password I used to encrypt backups on my old computer meaning I entered 2 password: my sudo password and my backups password.

                • Note the file:// prefix for my backups folder path.

                • It took a few minutes to generate the output file.




              3. Back up /home/klenwell/projects on my new computer just to be safe in case duplicity tries to restore the backup folder to same path for some strange reason:



                mkdir /tmp/new-projects-backup
                cp -R ~/projects /tmp/new-projects-backup



              4. Here's where the magic happens (it was a somewhat large directory so it took a few minutes in my case):



                sudo duplicity restore 
                --file-to-restore home/klenwell/projects
                file:///media/klenwell/my-external-drive/u2014
                /tmp/restored/u2014/projects



              5. And to confirm all went well, I should now see my old project directory restored:



                ls -al /tmp/restored/u2014/projects



              References




              • https://askubuntu.com/a/332914

              • Extract a Folder from Duplicity Archive

              • https://lists.nongnu.org/archive/html/duplicity-talk/2013-10/msg00002.html






              share|improve this answer




























                0












                0








                0







                First, a quick refresher from question above on the key paths I'll be working with here:




                • Folder from old dead computer I want to restore: /home/klenwell/projects

                • Folder of old computer backups on external drive (when plugged into new computer): /media/klenwell/my-external-drive/u2014

                • Folder on new computer where I want restore folder: /tmp/restored/u2014/projects


                Command Line



                From command line, here at the command I ran to restore the backup. See the next section for a step-by-step guide with explanation:



                # backup new project directory (to be safe)
                mkdir /tmp/new-projects-backup
                cp -R ~/projects /tmp/new-projects-backup

                # review list of backed up paths from old computer
                sudo duplicity list-current-files file:///media/klenwell/my-external-drive/u2014 > /tmp/u2014-backup-list.txt
                less /tmp/u2014-backup-list.txt

                # make destination folder for restored directory
                mkdir /tmp/restored/u2014/projects

                # restore backup
                sudo duplicity restore
                --file-to-restore home/klenwell/projects
                file:///media/klenwell/my-external-drive/u2014
                /tmp/restored/u2014/projects

                # confirm folder has been restored
                ls -al /tmp/restored/u2014/projects


                Step-By-Step Guide



                Here's a break down of the commands below with explanations for each command:





                1. Plug in external drive to new computer and confirm it's accessible:



                  ls -al /media/klenwell


                  Notes:




                  • In reality, the mounted external drive's directory name a random string like ksdfd987s-0sll1332-skd09233.

                  • To simplify this guide, I will assume it was named my-external-drive and backups were in folder u2014.




                2. Confirm I can see backed up files from older computer:



                  sudo duplicity list-current-files file:///media/klenwell/my-external-drive/u2014 > /tmp/u2014-backup-list.txt
                  less /tmp/u2014-backup-list.txt


                  Notes:




                  • I needed to use sudo to deal with this import error: https://lists.nongnu.org/archive/html/duplicity-talk/2013-10/msg00002.html

                  • I needed to know the password I used to encrypt backups on my old computer meaning I entered 2 password: my sudo password and my backups password.

                  • Note the file:// prefix for my backups folder path.

                  • It took a few minutes to generate the output file.




                3. Back up /home/klenwell/projects on my new computer just to be safe in case duplicity tries to restore the backup folder to same path for some strange reason:



                  mkdir /tmp/new-projects-backup
                  cp -R ~/projects /tmp/new-projects-backup



                4. Here's where the magic happens (it was a somewhat large directory so it took a few minutes in my case):



                  sudo duplicity restore 
                  --file-to-restore home/klenwell/projects
                  file:///media/klenwell/my-external-drive/u2014
                  /tmp/restored/u2014/projects



                5. And to confirm all went well, I should now see my old project directory restored:



                  ls -al /tmp/restored/u2014/projects



                References




                • https://askubuntu.com/a/332914

                • Extract a Folder from Duplicity Archive

                • https://lists.nongnu.org/archive/html/duplicity-talk/2013-10/msg00002.html






                share|improve this answer















                First, a quick refresher from question above on the key paths I'll be working with here:




                • Folder from old dead computer I want to restore: /home/klenwell/projects

                • Folder of old computer backups on external drive (when plugged into new computer): /media/klenwell/my-external-drive/u2014

                • Folder on new computer where I want restore folder: /tmp/restored/u2014/projects


                Command Line



                From command line, here at the command I ran to restore the backup. See the next section for a step-by-step guide with explanation:



                # backup new project directory (to be safe)
                mkdir /tmp/new-projects-backup
                cp -R ~/projects /tmp/new-projects-backup

                # review list of backed up paths from old computer
                sudo duplicity list-current-files file:///media/klenwell/my-external-drive/u2014 > /tmp/u2014-backup-list.txt
                less /tmp/u2014-backup-list.txt

                # make destination folder for restored directory
                mkdir /tmp/restored/u2014/projects

                # restore backup
                sudo duplicity restore
                --file-to-restore home/klenwell/projects
                file:///media/klenwell/my-external-drive/u2014
                /tmp/restored/u2014/projects

                # confirm folder has been restored
                ls -al /tmp/restored/u2014/projects


                Step-By-Step Guide



                Here's a break down of the commands below with explanations for each command:





                1. Plug in external drive to new computer and confirm it's accessible:



                  ls -al /media/klenwell


                  Notes:




                  • In reality, the mounted external drive's directory name a random string like ksdfd987s-0sll1332-skd09233.

                  • To simplify this guide, I will assume it was named my-external-drive and backups were in folder u2014.




                2. Confirm I can see backed up files from older computer:



                  sudo duplicity list-current-files file:///media/klenwell/my-external-drive/u2014 > /tmp/u2014-backup-list.txt
                  less /tmp/u2014-backup-list.txt


                  Notes:




                  • I needed to use sudo to deal with this import error: https://lists.nongnu.org/archive/html/duplicity-talk/2013-10/msg00002.html

                  • I needed to know the password I used to encrypt backups on my old computer meaning I entered 2 password: my sudo password and my backups password.

                  • Note the file:// prefix for my backups folder path.

                  • It took a few minutes to generate the output file.




                3. Back up /home/klenwell/projects on my new computer just to be safe in case duplicity tries to restore the backup folder to same path for some strange reason:



                  mkdir /tmp/new-projects-backup
                  cp -R ~/projects /tmp/new-projects-backup



                4. Here's where the magic happens (it was a somewhat large directory so it took a few minutes in my case):



                  sudo duplicity restore 
                  --file-to-restore home/klenwell/projects
                  file:///media/klenwell/my-external-drive/u2014
                  /tmp/restored/u2014/projects



                5. And to confirm all went well, I should now see my old project directory restored:



                  ls -al /tmp/restored/u2014/projects



                References




                • https://askubuntu.com/a/332914

                • Extract a Folder from Duplicity Archive

                • https://lists.nongnu.org/archive/html/duplicity-talk/2013-10/msg00002.html







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 1 hour ago

























                answered 2 hours ago









                klenwellklenwell

                1,49431925




                1,49431925






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1128178%2fhow-can-i-restore-a-folder-backed-up-on-my-old-computer-running-ubuntu-to-my-new%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    GameSpot

                    日野市

                    Tu-95轟炸機