All Projects → eslam-gomaa → virt-backup

eslam-gomaa / virt-backup

Licence: other
Fully backup your KVM Virtual Machines

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to virt-backup

Cv4pve Barc
Backup And Restore Ceph for Proxmox VE
Stars: ✭ 74 (+174.07%)
Mutual labels:  backup, restore, snapshot
Pgbackrest
Reliable PostgreSQL Backup & Restore
Stars: ✭ 766 (+2737.04%)
Mutual labels:  backup, restore, checksum
Knoxite
A data storage & backup system
Stars: ✭ 165 (+511.11%)
Mutual labels:  backup, restore, snapshot
Btrfs Sxbackup
Incremental btrfs snapshot backups with push/pull support via SSH
Stars: ✭ 105 (+288.89%)
Mutual labels:  backup, snapshot
Etcd Backup Restore
Collection of components to backup and restore the Etcd of a Kubernetes cluster
Stars: ✭ 99 (+266.67%)
Mutual labels:  backup, restore
Pitrery
PostgreSQL Point In Time Recovery made easy
Stars: ✭ 99 (+266.67%)
Mutual labels:  backup, restore
Backup
MySQL Database backup package for Laravel
Stars: ✭ 66 (+144.44%)
Mutual labels:  backup, restore
Pg rman
Backup and restore management tool for PostgreSQL
Stars: ✭ 197 (+629.63%)
Mutual labels:  backup, restore
Conserve
[beta] robust portable backup tool in Rust
Stars: ✭ 107 (+296.3%)
Mutual labels:  backup, restore
Nextcloud Backup Restore
Moved to codeberg.org - https://codeberg.org/DecaTec/Nextcloud-Backup-Restore - Bash scripts for backup/restore of Nextcloud
Stars: ✭ 115 (+325.93%)
Mutual labels:  backup, restore
Checkpoint
Fast and simple homebrew save manager for 3DS and Switch.
Stars: ✭ 1,886 (+6885.19%)
Mutual labels:  backup, restore
Bareos Webui
Bareos Web User Interface
Stars: ✭ 78 (+188.89%)
Mutual labels:  backup, restore
Rdiffweb
A simplified backup management software for quick access to your archives through an efficient web interface.
Stars: ✭ 76 (+181.48%)
Mutual labels:  backup, restore
Zmbackup
A reliable software written in Shell Script to help you in your daily task to backup and restore mails and accounts from Zimbra Open Source Email Platform. Project in deprecation process. Please help me with Waddles.
Stars: ✭ 103 (+281.48%)
Mutual labels:  backup, restore
Backy2
backy2: Deduplicating block based backup software for ceph/rbd, image files and devices
Stars: ✭ 126 (+366.67%)
Mutual labels:  backup, snapshot
Cognito Backup Restore
AIO Tool for backing up and restoring AWS Cognito User Pools
Stars: ✭ 142 (+425.93%)
Mutual labels:  backup, restore
Helicopterizer
Backup and Restore for Docker Container!
Stars: ✭ 112 (+314.81%)
Mutual labels:  backup, restore
Backintime
Back In Time - A simple backup tool for Linux
Stars: ✭ 1,066 (+3848.15%)
Mutual labels:  backup, snapshot
Packagesync
Sync sublime text packages & user settings across devices.
Stars: ✭ 63 (+133.33%)
Mutual labels:  backup, restore
Backup Manager
Database backup manager for dumping to and restoring databases from S3, Dropbox, FTP, SFTP, and Rackspace Cloud
Stars: ✭ 1,589 (+5785.19%)
Mutual labels:  backup, restore

virt-backup 🚀

Fully backup & restore your KVM Virtual Machines


virt-backup Features:

  • Ability to backup all the VM's disks or only system disk
  • compress the backup directly in a ZIP file, which decreases backup size
  • validate the restore process with the checksum of the original VM (taken on backup)
  • Ability to backup and restore all the VM's snapshot - [ Internal Snapshots ]

Install

At least Ruby Version 2.4 is needed, Here is how to install Ruby 2.5 on different distributions

Just install the gems used and you're good to go (Assuming that you have KVM installed)

gem install rubysl-tempfile
gem install rubysl-optparse
gem install open4
gem uninstall zip # Need to be removed if installed
gem install rubyzip
git clone https://github.com/eslam-gomaa/virt-backup.git
cd virt-backup
ruby virt-backup.rb --help
Prefered way to install

cd /var
git clone https://github.com/eslam-gomaa/virt-backup.git
alias virt-backup="ruby /var/virt-backup/virt-backup.rb"
# Put it in ~/.bashrc for persistence.
# echo 'alias virt-backup="ruby /var/virt-backup/virt-backup.rb"' >> ~/.bashrc
virt-backup -h

Test

📌 The tests are done by an automated Jenkins pipeline

Distro Test Result
Ubuntu 16.04
Ubuntu 18.04
Ubuntu 20.04
CentOS 7
CentOS 8
fedora-34
Debian 10
Debian 11

Note for Debian 11 Users (Consider that issue)

It works fine on my tests, but if you'll use the --with-snapshots or -s option make sure to test to restore your VM



Examples

  • Backup a VM with all its disks

Note To backup the Snapshots of the VM, use the option --with-snapshots

ruby virt-backup.rb --backup \
 --with-snapshots \
 --original-vm kubernetes-master \
 --save-dir /var/lib/libvirt/images/backup/
  • Backup a VM with only system disk
ruby virt-backup.rb --backup \
 --with-snapshots \
 --original-vm kubernetes-master \
 --system-disk-only \
 --save-dir /var/lib/libvirt/images/backup/
  • Restore a VM from backup

Note no options needed when restoring a backup with only system disk, the script detects and handles that.

Note To restore the Snapshots of the VM, use the option --with-snapshots

ruby virt-backup.rb --restore \
 --with-snapshots \
 --backup-file /var/lib/libvirt/images/backup/kubernetes-master.zip \
 --restore-dir /var/lib/libvirt/images/backup/
  • Backup without compression

supported (--compression) values are: default, none, best Default: best

ruby virt-backup.rb --backup \
 --with-snapshots \
 --original-vm kubernetes-master \
 --system-disk-only \
 --compression none
 --save-dir /var/lib/libvirt/images/backup/

Example screenshots

Assuming you have installed this way

🚩 Backup

mkdir /var/lib/libvirt/images/backup/

virt-backup --backup \
  --with-snapshots \
  --original-vm cirros \
  --save-dir /var/lib/libvirt/images/backup/

image

🚩 Restore

virt-backup --restore \
  --with-snapshots \
  --backup-file /var/lib/libvirt/images/backup/cirros.zip \
  --restore-dir /var/lib/libvirt/images/

image



Updates & Fixes

  • If md5 mismatch found, print where is the difference ✔️
  • Pause the VM before collecting the checksum ✔️
  • Fix: Error if snapshot name has a space ✔️
  • Fix: Restore snapshot --> stable now ✔️
  • Update: Zip 64 bit is added (the support to backup & restore large disk files) ✔️
  • Add command-line control to the compression level ✔️


Note
The script does the job perfectly, However to add more features easily the code needs to be refactored,

And since that would take a few weeks, at least 3 features/enhancements should be requested first.



Thank you

Eslam Gomaa

.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].