LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Need help with a solid backup plan for VMs (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/need-help-with-a-solid-backup-plan-for-vms-4175725022/)

scottl31 05-12-2023 07:11 PM

Need help with a solid backup plan for VMs
 
The last several months I have been learning more about Linux, but more specifically running self hosted VPSs. I have been using VirtualBox, KVM and just started trying UTM.

I run Ubuntu or CentOS 7 (both minimal if possible) with no GUI to save on memory and performance.

My purpose is web servers with (or equal to) Apache, PHP, MySql, Postfix, Dovecot. I've tried loads of admin panels and sort of settled on one I'm happy with. Testing seems good and everything seems to work the way I want and expect.

But before I can start to run actual sites/email, etc., I need a solid backup plan. So that's where I'm stuck.

I imagine there's ways to just back up the VMs on the host OSs, but I don't know if that would be reliable with all services up and running on the VMs. I want to do everything the "Linux" way, as if the VM was an actual computer.

The main tool for backup seems to be rsync. But with loads of searching I can't seem to find what I want to do (with rsync or anything else), which is:

First, I want to do everything remotely, including recover from any disaster, with the exception of a power failure on the host machines, which are in another city.

I want to run scheduled live daily (or whatever) backups from one VM to another VM (on different physical hardware) which I think (or hope) could be saved as a file which could be used to restore back to the source (or new) VM in the event of a problem/crash/hack, etc. with the original source VM. Also be able to use to migrate from one VM to another, which I assume is the same. This backup is the only thing this destination VM would be used for.

If anyone knows of a video or tutorial that has anything like this or you could otherwise help, I really appreciate it.

Thanks,
Scott

jmgibson1981 05-12-2023 07:55 PM

While I'm hardly any kind of expert with VM's my thinking would be to run the backups in each VM. Maybe create a script of some sort that can be shared among them. Then just have each one run the script backing up the appropriate data to the defined location. Then it's just backups for a individual "machine" rather than trying to capture the images themselves.

wpeckham 05-12-2023 08:08 PM

Where I have been sysadmin and backed up virtual guests, we acted form the host-0 level and froze the guest, fast copied the settings files and the files or folder for that guest, then unfroze the guest. I never had it fail. We used a similar process to live-migrate OpenVZ and LXC guests and it worked well. I have never tried a non-manual migration of QEMU or Virtualbox guests. VMWare has their own special toolset for backup and migrations.

scottl31 05-13-2023 03:24 PM

Sorry guys, but I guess I'm not as experienced as I thought I was. I have no idea what or how to do what you first two responders mention.

Am I asking for something that's just not possible? I guess I assumed it would be because I have been doing the same thing on all our windows and mac machines for years.

jefro 05-16-2023 03:54 PM

Windows has live state ways to backup some files.

There are some VM programs that offer commercial live backup and live cloning/moving.

I've not heard of any advanced features from the free virtualbox.

On any VM you can easily create a VM backup server or virtual nas to keep data copied. This is where local network adapter might be useful.

Knowing your databases and programs is vital to knowing if you can use various ways to copy. At one time I used to have to drop all databases to clone.


All times are GMT -5. The time now is 09:30 PM.