Home VM Backup 4 Ways to Set up Proxmox Offsite Backup

4 Ways to Set up Proxmox Offsite Backup

2024-02-28 | Iris Lee

Table of contents
  • The necessity of Proxmox offsite backup
  • Method 1: Implementing Proxmox Offsite Backup with PBS
  • Method 2: Establish offsite backup and restore through Proxmox ZFS
  • Method 3: Using VZDump to create backups to a USB disk
  • Method 4: Set up offsite backup copy with Vinchin Backup & Recovery
  • Proxmox offsite backup FAQs
  • Conclusion
Are you looking for a robust VM backup solution? Try Vinchin Backup & Recovery!↘ Download Free Trial

Data is the lifeblood of any business. Protecting this vital asset against various threats such as hardware failure, software corruption, and natural disasters is paramount. Proxmox VE offers a comprehensive server management platform that integrates virtualization technologies, like KVM and LXC, for managing virtual machines and containers. However, even the most robust systems are vulnerable to catastrophic events. This is where offsite backup becomes a critical strategy for ensuring business continuity.

The necessity of Proxmox offsite backup

Offsite backup involves storing backup data at a location geographically separate from the primary site. It serves as an essential component in a well-rounded disaster recovery plan, allowing businesses to recover from data loss incidents without significant downtime. Offsite backups protect against local disasters that could potentially wipe out on-site data, ensuring that a copy of crucial data is secure and recoverable.

Method 1: Implementing Proxmox Offsite Backup with PBS

The standard approach to implementing offsite backup in Proxmox involves setting up an additional Proxmox Backup Server at a remote location. PBS is a dedicated backup solution for Proxmox VE environments that supports incremental backups, deduplication, and encryption. The following steps outline the process:

1. Set up two Proxmox Backup Servers

Primary PBS: This is your main backup server where all your local backups are stored.

Secondary PBS: This is the offsite backup server located at a different physical location. The purpose of this server is to have a redundant copy of your data in case the primary location is compromised (due to natural disasters, hardware failure, etc.).

2. Configure the primary PBS

On your primary PBS, you will configure your backup jobs as usual. This involves setting up data sources (like VMs or containers) and scheduling when backups should be taken.

3. Set up a sync job

Once your primary PBS is operational and backups are being made, you can set up a synchronization task to replicate these backups to the secondary PBS:

a. Establish a secure connection between the two PBS servers. This could be a VPN, dedicated line, or any secure method to ensure the data is encrypted during transfer.

b. Configure the necessary authentication between the two servers. Proxmox Backup Server supports tokens which can be used to authenticate and authorize the sync tasks.

c. On the primary PBS, you would create a sync task. This task would specify which datastores to synchronize, the destination (your secondary PBS), and the schedule for synchronization (e.g., daily, weekly, etc.).

After setting up the sync task, it’s essential to monitor its progress and maintain both the primary and secondary PBS instances. This includes checking for successful sync operations, ensuring that the secondary server has enough storage space, and verifying the integrity of the backups.

Method 2: Establish offsite backup and restore through Proxmox ZFS

Proxmox VE has built-in support for ZFS. ZFS is a highly scalable file system and logical volume manager that is ideal for backup and restore as it supports snapshots, replication and more. One of the features of zfs is that it can create snapshots and transfer them to remote machines, achieve incremental backups, and restore from any backup file at any time.

To set up offsite backup and restore via ZFS in Proxmox VE, you can follow these steps:

1. Set up a ZFS storage pool locally

First, you need to set up a ZFS storage pool on your local Proxmox server (if you haven’t already). You can use the “zpool” command to create a new storage pool:

zpool create yourpoolname raidz /dev/sda /dev/sdb /dev/sdc

Here “yourpoolname” is your storage pool name, “raidz” is a data protection level of ZFS, and “/dev/sda /dev/sdb /dev/sdc” is the disk device.

2. Create ZFS data sets and snapshots

Then, you need to create datasets in the storage pool and create snapshots on the datasets that need to be backed up:

zfs create yourpoolname/datasetname
zfs snapshot yourpoolname/datasetname@snapshotname

3. Set up a remote Proxmox server

A ZFS storage pool also needs to be set up on the offsite Proxmox server. Make sure this server can access the local Proxmox server through the network.

4. Configure SSH passwordless login on the local server

In order to be able to perform offsite backup, the local server needs to be able to log in to the offsite server through SSH without a password. You can achieve this via SSH key authentication:

ssh-keygen
ssh-copy-id user@remotehost

Here “user” is the user on the remote server, and “remotehost” is the host name or IP address of the remote server.

5. Backup using ZFS Send and Receive

Through the send and receive functions of ZFS, you can send snapshot data to an off-site server:

zfs send yourpoolname/datasetname@snapshotname | ssh user@remotehost zfs receive remotepoolname/datasetname

6. Automate the backup process

You can automate the backup process through cron jobs. Edit cron job file:

crontab -e

Then add a line to set your desired backup frequency:

0 2 * * * /usr/sbin/zfs send yourpoolname/datasetname@snapshotname | ssh user@remotehost zfs receive remotepoolname/datasetname

This example will perform a backup at 2 am every day.

7. Restore backup

If you need to restore data from an offsite backup, you can use the ZFS receive function to restore the snapshot:

ssh user@remotehost zfs send remotepoolname/datasetname@snapshotname | zfs receive yourpoolname/datasetname

Make sure there are no snapshots in use on the local dataset before restoring, otherwise errors may result.

During this process, you need to ensure that your network connection is stable, especially when transferring large amounts of data. Considering encrypting data to protect sensitive information. If your data set is large, the first backup may take longer. Incremental backups can then be used to reduce the time required.

Method 3: Using VZDump to create backups to a USB disk

Using VZDump to create backups to a USB disk is also a viable method for offsite backup. VZDump is a utility that can create backups of virtual machines and containers running on Proxmox VE. Here’s how you can use it for offsite backups:

1. Connect a USB disk: Attach a USB disk to the Proxmox VE host system. You may need to mount the disk manually if Proxmox doesn’t do it automatically.

2. Identify the USB disk: Identify the mount point of the USB disk by using the “lsblk” or “fdisk -l” command. It will typically be something like “/dev/sdb1”, and its mount point might be something like “/mnt/usbbackup”.

3. Prepare the Mount Point: If necessary, create a directory to mount the USB disk and then mount it:

mkdir -p /mnt/usbbackup
mount /dev/sdb1 /mnt/usbbackup

4. Configure VZDump backup job: Configure a VZDump backup job through the Proxmox VE web interface or via the command line to use the USB disk’s mount point as the backup destination.

5. Run VZDump: Run the VZDump command to create a backup of a VM or container. For example:

vzdump <vmid> --storage /mnt/usbbackup --mode snapshot

   Replace “<vmid>” with the ID of the VM or container you want to back up.

6. Automate the Backup: To automate the backup process, you can create a cron job that runs VZDump at regular intervals.

7. Eject and Store the USB Disk: After the backup is complete, you should safely unmount the USB disk and store it in an offsite location:

umount /mnt/usbbackup

Then physically disconnect the USB disk and store it securely.

If possible, use multiple USB disks and rotate them regularly to ensure that you have multiple generations of backups. This provides better protection against data loss.

Method 4: Set up offsite backup copy with Vinchin Backup & Recovery

While Proxmox VE’s native tools offer basic offsite backup capabilities, organizations looking for a more streamlined, feature-rich, and scalable solution may consider Vinchin Backup & Recovery. Vinchin enhances Proxmox VE’s data protection with easy-to-manage backup capabilities and instant recovery options. Vinchin facilitates the 3-2-1 backup strategy by allowing extra backup copies to be stored offsite, ensuring disaster recovery and continuous business operations if primary backups fail.

1. Add offsite backup storage

Add offsite backup storage

2. Select Copy Source from the created backup job

Select Copy Source from the created backup job

3. Select Copy Strategies

Select Copy Strategies

4.Review and submit the job

Disaster recovery will be more effective with Vinchin Instant Recovery and Offsite Copy working together. The failed VM can be restarted on the second site in 15 seconds to quickly recover business system. Besides Proxmox, Vinchin supports over 10+ virtual platforms like VMware, Hyper-V, XenServer, oVirt, XCP-ng, etc. You have a 60-day full-featured free trial to experience how effective Vinchin Backup & Recovery is to make offsite server backup.

Proxmox offsite backup FAQs

1. Q: Can I replicate VMs between different Proxmox clusters for offsite backup purposes?

A: Yes, Proxmox includes built-in support for VM replication, which can be used to replicate VMs to another Proxmox cluster at an offsite location. This is often used for high availability and disaster recovery purposes.

2. Q: Can I compress or deduplicate Proxmox Offsite Backups to save space?

A: Yes, Proxmox backup jobs can be configured to compress backup data. Deduplication is not provided out-of-the-box but can be achieved with third-party tools or by using file systems that support deduplication, like ZFS.

Conclusion

Offsite backups are a non-negotiable aspect of a comprehensive disaster recovery plan. For Proxmox VE users, setting up a remote Proxmox Backup Server is a viable option to achieve offsite data protection. However, to overcome the inherent limitations of PBS and to leverage more sophisticated backup capabilities, organizations should consider integrating third-party solutions like Vinchin Backup & Recovery. By doing so, they can ensure robust, scalable, and easy-to-manage backup systems that safeguard their virtualized environments against any form of data loss.

Share on:

Categories: VM Backup