How to Backup and Restore Ubuntu Server Using Tar in Terminal

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

ความคิดเห็น • 78

  • @Eofold
    @Eofold 6 ปีที่แล้ว +1

    Wow. No need for expensive backup software. This method works like a charme. In combination with a crontab and grive this is the easiest and cheapest automated backup method ever. Thank you so so much for this video. You are awesome.

  • @reindeboer7374
    @reindeboer7374 5 ปีที่แล้ว +4

    Hey man, I really appreciate your work here, explaining every single thing without raising me questions. Very nice!

  • @lopoka1
    @lopoka1 2 ปีที่แล้ว +1

    Very very clear and concise video, thank you for this video. You definitely deserve much more subs !

  • @LachezarDolmov
    @LachezarDolmov 3 ปีที่แล้ว

    Thank you very much! I didn't knew about the --one-file-system and have been excluding all directories manually. I'm gonna try this option as well :)

  • @dewmguy
    @dewmguy 5 ปีที่แล้ว

    Sweet video. I hope i don't have to use it! Your explanation was 100% thorough and clear, you didn't ramble on or have an annoying intro, and your speaking skills are strong. Honestly a top 10 video for me on youtube. TH-camrs should use you as a reference on how to make a tutorial video.

  • @johnthebest6819
    @johnthebest6819 9 ปีที่แล้ว +5

    WOW . Thank you Very very very much . simple clear . i can't find more words .

    • @OddRandomThoughts
      @OddRandomThoughts  9 ปีที่แล้ว +1

      Thank you +Julia A for the kind words. I'm glad you found it helpful!

  • @treasuretron
    @treasuretron 4 ปีที่แล้ว +1

    THIS WAS AWESOME!!! Perfect, this was exactly what I needed, thankyou!!

  • @rokfam
    @rokfam 3 ปีที่แล้ว +1

    Thank you, Sir. It is exactly what I thought is possible: a simple solution. I wondered if the xtract would cause the new location system to error out or fail upon reboot if something is not compatible. One would need to restore between identical versions of the same OS I suppose? My plan is to backup my VPS and be assured I can take it over to another hosting service should the need ever arise. Is you method a sane solution to my use case or should I consider a different approach?

  • @Seedlinux
    @Seedlinux 9 ปีที่แล้ว

    Thanks as always ! Super simple tutorial and well done!

  • @MustafaNightcore
    @MustafaNightcore 2 ปีที่แล้ว

    hey bro thx lot you have helped me with my biggest problem

  • @Autamization
    @Autamization 9 ปีที่แล้ว +1

    My Hero, Awesome video Thank You!

  • @Fawkes-ent
    @Fawkes-ent 3 ปีที่แล้ว

    Great video would this backup databases and also settings for services I have made auto run thanks.

  • @johnstowers4609
    @johnstowers4609 9 ปีที่แล้ว +2

    Excellent job! Thank you very much!

    • @OddRandomThoughts
      @OddRandomThoughts  9 ปีที่แล้ว

      +John Stowers You are quite welcome, thanks for watching!

  • @harrisonpatrick3553
    @harrisonpatrick3553 7 ปีที่แล้ว

    Thanks alot! very well explained. I'm currently in a trade for Microsystems and Networks, so this is really helpful! Thanks again :D

  • @stevenfrazier7959
    @stevenfrazier7959 9 ปีที่แล้ว +2

    An excellent job, thanks for sharing. Really helpful.

  • @aggrotic
    @aggrotic 6 ปีที่แล้ว +1

    how do i have to do this to migrate from one vps to another server? I only get errors after rebooting :( there has to be an easy way to migrate the server (with all users/groups, configurations and files)

  • @PurnenduSingh03
    @PurnenduSingh03 7 ปีที่แล้ว +1

    Please I am also looking for the reply on @Perfect Prog question.
    Is it possible to restore backup to another system?

  • @js_programmer8423
    @js_programmer8423 3 ปีที่แล้ว

    i did exactly what he told me to do..everything worked but when i logged out i was unable to log back in after the back up

  • @LeonelProg
    @LeonelProg 8 ปีที่แล้ว +4

    excelent! this backup the entire server? and i can restore a copy to another server? with sql database and all exactly like the original? like a clone server

    • @dewmguy
      @dewmguy 5 ปีที่แล้ว +1

      Please answer this question @Odd Random Thoughts

    • @SM-bp3me
      @SM-bp3me 4 ปีที่แล้ว

      Yes, just tried myself on ubuntu budgie. Thus i dont know how it would be if i restored on a system with an other desktop environment or s.th.
      what i did exactly was reinstalling the system from scratch and then extracting the backup.tar.gz like described in the video.

  • @trustabyss
    @trustabyss 2 ปีที่แล้ว

    This doesn't explain how to match the backup archive with the destination. If you installed software after the backup, the files will still remain. The only solution I've found is to boot into a live Linux distro, mount the local file system, delete every file under /, mount the drive containing backup, and restore the contents back into /. This is obviously not a good idea for SSD drives. Any suggestions on a better way of doing this?

  • @britanniaonlineenglishscho1843
    @britanniaonlineenglishscho1843 8 ปีที่แล้ว

    And if when I was creating a tarball of a full system backup (/ and /home in my case) I was using Ubuntu Live DVD and I haven't excluded anything from either / or /home, then when I will be restoring the system again with the Live DVD, is it a must to use --numeric-owner switch in the tar command?

  • @applewinston
    @applewinston 5 ปีที่แล้ว

    Thank for the video but can I Tar the root directory if the OS is running ? Will it having trouble tar the root directory if I am using tar command in the same linux OS to backup the whole system ?

  • @navzme
    @navzme 7 ปีที่แล้ว

    Good tutorial. Thank you very much.

  • @arunnarayanan9702
    @arunnarayanan9702 6 ปีที่แล้ว

    Nice one, but i have some questions, can i take backup in server 1 and can i restore that in server 2 will it works?, if yes can i use the two different versions of Ubuntu, for example server 1 is 14.04 and server 2 is 16.04 will it works? my another question is can i access the backup files from my local Ubuntu machine? if yes can you please explain a bit? thank you !

  • @MrShivrajansingh
    @MrShivrajansingh 4 ปีที่แล้ว

    Please tell how to exclude more than one directory

  • @vikassoundate4657
    @vikassoundate4657 4 ปีที่แล้ว

    thanks man, that helped me. cheers!

  • @LithinThampan
    @LithinThampan 6 ปีที่แล้ว

    Hi, great solution for backup and restore an entire server.
    Will this help to restore between VPS between different cloud service provider? For example AWS uses its own ubuntu distribution and Digital ocean uses its own distributions and what is the impact on network files and distribution files ?
    Thanks in advance

  • @DeepakKumar-xz2rp
    @DeepakKumar-xz2rp 8 หลายเดือนก่อน

    thanks - very useful

  • @harnam-chana
    @harnam-chana 9 ปีที่แล้ว

    Nice! perfectly explained

    • @OddRandomThoughts
      @OddRandomThoughts  9 ปีที่แล้ว

      ***** Thanks for the kind words. I hope you found it helpful. :)

  • @kankulivae648
    @kankulivae648 2 ปีที่แล้ว

    would this work if i was going to install cpanel to my server? Sorry newbie. Im trying to do a reinstall cpanel on my server but need to back up content on my current root so that when I do a reinstall I can recover whats on my server now. Is that possible? What do you recommend me doing?

  • @katrinafarmer6704
    @katrinafarmer6704 6 หลายเดือนก่อน

    do u have a discord? once it gets to efi it halts with previous errors and just goes to grub only after reboot

  • @smallmoneybigmoney
    @smallmoneybigmoney 5 ปีที่แล้ว

    Interesting. Does this keep file permissions and existing users?

  • @mohsenazadmanesh2245
    @mohsenazadmanesh2245 6 หลายเดือนก่อน +1

    very good

  • @NicolasHanna
    @NicolasHanna 6 ปีที่แล้ว

    Big Help - good job

  • @Shuliyey
    @Shuliyey 8 ปีที่แล้ว +1

    ty so much for this one ;)

  • @juanjosecamacho6168
    @juanjosecamacho6168 2 ปีที่แล้ว

    Thank you so so so much!!!!!!!!!

  • @danobot12
    @danobot12 9 ปีที่แล้ว +1

    What if you created new files between creating the back up and restoring it? You said unzipping the backup will overwrite all files. What about those files that were added in the meantime? They are junk after the backup is restored and they might interfere with the restored installation. How would you handle that?

    • @OddRandomThoughts
      @OddRandomThoughts  9 ปีที่แล้ว

      +danobot Hi, just to clarify, any file created after the archive, will have no equivalent stored in the archive and thus will remain untouched. Therefore any new files you create will remain as they are, only files that are included in the backup would be overwritten.
      This would only be a problem if you were trying to restore onto a new installation on the same hardware, at which point only what was on the archive would be restored, that's why it's important to run a new backup when every you've made important changes or additions to your server. Hope this helps.

    • @danobot12
      @danobot12 9 ปีที่แล้ว

      +Odd Random Thoughts yeah that makes sense. Kinda worried about forgotten junk files though. Do you reckon there's a way to diff the archive and the file system before restoring the backup to get rid of files that are not in the back up? (obviously excluding the directories that are not included in the backup like /dev)

    • @OddRandomThoughts
      @OddRandomThoughts  9 ปีที่แล้ว

      +danobot Well what I would do if I wanted to restore the backup just as it was without including anything that had been added after it....Just do a clean install of ubuntu server and then extract the backup over that. That would eliminate any files that had been added after the backup had been created.

  • @JackReacher1
    @JackReacher1 2 ปีที่แล้ว

    wow what a champ

  • @Lordblanca
    @Lordblanca 4 ปีที่แล้ว

    Will this work on ubuntu server 18.04 as well or is there another command line for 18.04

  • @bangkokskater
    @bangkokskater 8 ปีที่แล้ว

    hi, great tutorial, BUT I have this error during RESTORE
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

    • @bangkokskater
      @bangkokskater 8 ปีที่แล้ว

      service mysql restart also could NOT work. [fail]

  • @fredneedle123
    @fredneedle123 6 ปีที่แล้ว

    Can you use this method to restore your broken server to new metal?

  • @VarDovoli
    @VarDovoli 9 ปีที่แล้ว

    how would I add encryption to the backup and not lose any permissions or remove leading / from file names? nice video by the way.

    • @OddRandomThoughts
      @OddRandomThoughts  9 ปีที่แล้ว

      Var D'ovoli when you're talking encrypting the backup you're envolving public/private key generation as well as creating a file with a passphrase etc. It can be somewhat overwhelming to the basic user. Not saying you are one of the basic users, but you may look into either openssl for creating your encryption or possibly symmetric encryption may be an option ie. tar -cz / | gpg -c -o backup.tgz.gpg
      the .gpg represents an encrypted archive. Hope this helps some.

  • @garretmartin2662
    @garretmartin2662 ปีที่แล้ว

    Wish I knew this earlier

  • @applewinston
    @applewinston 6 ปีที่แล้ว

    Is it possible to tar the whole root directory and restore it after formatting the OS?

  • @haidalejandroavilacarlon2110
    @haidalejandroavilacarlon2110 8 ปีที่แล้ว

    Excellent!

  • @VinodKumar-ox6bg
    @VinodKumar-ox6bg 6 ปีที่แล้ว

    after restore backup an other server ssh not login can you help ??

  • @Jin33334
    @Jin33334 9 ปีที่แล้ว +1

    easy and great

  • @dimitrisarch8014
    @dimitrisarch8014 5 ปีที่แล้ว

    Thanks!!!!

  • @aabaev
    @aabaev ปีที่แล้ว

    still actual 👍

  • @SonofaTech
    @SonofaTech 6 ปีที่แล้ว

    bad ass

  • @Tali1562
    @Tali1562 7 ปีที่แล้ว

    thanks!

  • @ricko13
    @ricko13 4 ปีที่แล้ว +1

    Too late :(
    I run the command: "sudo chmod 755 -R / "
    (YES, IN THE F*CKING ROOT directory)

  • @NullifidianYT
    @NullifidianYT 7 ปีที่แล้ว

    Thanks.

  • @displacementsmc
    @displacementsmc 6 ปีที่แล้ว

    Hi. when executing your command to backup my ubuntu server, at some point I got this:
    tar: /run/: file is on a different filesystem; not dumped
    /media/
    /opt/
    /sys/
    tar: /sys/: file is on a different filesystem; not dumped
    What is it means?

  • @RohitGupta-ki9tn
    @RohitGupta-ki9tn 7 ปีที่แล้ว

    hello sir i m not able to restored backup

    • @RohitGupta-ki9tn
      @RohitGupta-ki9tn 7 ปีที่แล้ว

      tar (child): /path/to/yourbackupfilename.tar.gz: Cannot open: No such file or directory
      tar (child): Error is not recoverable: exiting now
      tar: Child returned status 2
      tar: Error is not recoverable: exiting now

  • @DooryardGarage
    @DooryardGarage 8 ปีที่แล้ว

    Does this still hold up with Ubuntu 16?

    • @OddRandomThoughts
      @OddRandomThoughts  8 ปีที่แล้ว

      Hi, yes to the best of my knowledge this should still work the same if you're using Ubuntu 16. It wouldn't hurt anything to try it and see though if you have a freshly installed machine. Let me know how it turns out if you would. Thanks for watching! :)

  • @HarryoGaming
    @HarryoGaming 7 ปีที่แล้ว

    Thanks very helpful! Like and from me subscribe.

  • @zl0y
    @zl0y 9 ปีที่แล้ว

    У меня по Английскому двойка была(((

  • @KenpachiStarcraft
    @KenpachiStarcraft 8 ปีที่แล้ว +3

    Thank you so much for this video!

  • @ratfuk9340
    @ratfuk9340 2 ปีที่แล้ว

    Awesome video, thank you.

  • @incog2678
    @incog2678 22 วันที่ผ่านมา

    Thank you

  • @earnestredwood4694
    @earnestredwood4694 7 ปีที่แล้ว

    Thank you...