Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to do a full backup from a entire VPS
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to do a full backup from a entire VPS

Hi,

Don't know if it possible or no...

Is it possible to perform a full backup from a entire VPS (OpenVZ or KVM)?

I was thinking, if it's possible to do like a .iso and than, if we want to use it in a future, just perform a restore from a .iso...

Is it possible?

Comments

  • IkoulaIkoula Member, Host Rep

    Hello, you can perform a snapshot on some platforms but i recommend to use a third party like r1soft.

  • If its KVM, then this is what you want:

    http://www.delimitervps.com/landingpage/r1backup/

  • DewlanceVPSDewlanceVPS Member, Patron Provider
    edited November 2015

    You can take a backup of mysql data, etc and move it.




    If you want a backup of your whole VPS then contact your provider and they will do this for you.

    Thanked by 1plopes
  • What about dd'ing the entire hdd to another device?

  • NyrNyr Community Contributor, Veteran

    With OVZ you can simply rsync.

    Thanked by 1plopes
  • WebProjectWebProject Host Rep, Veteran

    if you do have 25GB VPS size, it will take quite a while to backup via shared 100Mbps port. You can do snapshot of your VPS account, if your provider support it.

  • @Nyr said:
    With OVZ you can simply rsync.

    Nyr can you be more specific?

    How?

  • Mr. Google can be more specific, just type in "rsync vps backup".

    Thanked by 1plopes
  • i thinck your provider if is good guy can help you too to give you a full image

    Thanked by 1plopes
  • rincewindrincewind Member
    edited November 2015

    dd and ssh like @faulwurf mentioned?
    As root,

    dd if=/dev/vda | gzip -1 - | ssh user@backupvps dd of=image.iso.gz

    Alternately do mkisofs / instead of dd

    EDIT: mkisofs may barf on proc, sys or dev filesystems.

    Thanked by 1plopes
  • plopesplopes Member
    edited November 2015

    doing this
    dd if=/dev/vda | gzip -1 - | ssh [email protected] dd of=image.iso.gz
    give me a error

    opening /dev/vda: No such file or directory

    shoul I do only /dev instead dev/vda?

    dd if=/dev | gzip -1 - | ssh [email protected] dd of=image.iso.gz

  • Check fdisk -l (or equivalent, whatever) and replace accordingly.

    @plopes said:
    doing this
    dd if=/dev/vda | gzip -1 - | ssh [email protected] dd of=image.iso.gz
    give me a error

    opening /dev/vda: No such file or directory

    shoul I do only /dev instead dev/vda?

    dd if=/dev | gzip -1 - | ssh [email protected] dd of=image.iso.gz

  • Do mount | grep ext to find out your device. If you see exactly one line, then use that - most likely /dev/sda or /dev/sda5. Otherwise, you have multiple partitions and it gets more complicated, and this method wont work as-is.

    You would need to be root when executing this command, but dont need root access on destination/backup VPS. So you could ssh [email protected].

    Thanked by 1plopes
  • Or, if your provider uses SolusVM, ask them to enable quick backups. It'll create a vzdump and place it into your VPS. (OpenVZ only, I think)

    Thanked by 1plopes
  • @rincewind said:
    Do mount | grep ext to find out your device. If you see exactly one line, then use that - most likely /dev/sda or /dev/sda5. Otherwise, you have multiple partitions and it gets more complicated, and this method wont work as-is.

    You would need to be root when executing this command, but dont need root access on destination/backup VPS. So you could ssh [email protected].

    I have done mount | grep ext but didn't gave me output

  • Try "fdisk -l" for a list of HDDs and their partitions.

    Thanked by 1plopes
  • @Hidden_Refuge said:
    Try "fdisk -l" for a list of HDDs and their partitions.

    I have done fdisk -lbut didn't gave me output as well

  • As root? It has to run as root. Should work on KVM. OpenVZ has no real HDD so it would probably show nothing.

    Thanked by 1plopes
  • ok... it's a openvz

  • Just to confirm: I've run "fdisk -l" on a small development VPS on my OpenVZ node and it returns nothing. The reason is as mentioned about that OpenVZ has no real HDD neither any real partition.

    So if you use dd you most likely have to specify the root as your directory (the root is " / ") with a OpenVZ VPS because there are no existing hard drives or partitions in /dev.

    Thanked by 1plopes
  • plopesplopes Member
    edited November 2015

    dd if=/ | gzip -1 - | ssh [email protected] dd of=image.iso.gz

    tried... but just have copied 20bytes :(

  • dd only works if you have access to the raw device. It's not going to work on OpenVZ. You will need support from your provider if you want a raw dump, like others have suggested. Or go for rsync for backing up your files.

    Thanked by 1plopes
  • not very expert on this... sorry :(

    any help to install and run it on a openvz vps?

  • Backing up the whole / makes no sense anyway. There are things that can't be backed up and simply shouldn't be backed up.

    Try https://freevps.us/thread-11060.html?highlight=backup

  • plopes said: not very expert on this... sorry :(

    You only need Tar and SSH on the source server, then create a file with the data of this server like here:

    https://github.com/willgrz/Autobackup/blob/master/serverlist.template

    Then run bash backup.sh on the backup server.

Sign In or Register to comment.