How to Easily Backup and Restore Proxmox with Command Line?

Proxmox backup VM command line is a function that performs virtual machine backups on Proxmox virtualization platform using a command line interface. By running appropriate commands, administrators can easily and flexibly perform VM backup operations.

download-icon
Free Download
for VM, OS, DB, File, NAS, etc.
dan-zeng

Updated by Dan Zeng on 2024/04/26

Table of contents
  • Benefits of Proxmox backup VM command

  • How to perform Proxmox VM backup using Shell command?

  • How to backup Proxmox VM with WinSCP command?

  • How to use scripts to restore the Proxmox VM backup?

  • How to backup Proxmox VMs with Vinchin?

  • FAQ

  • Conclusion

Are you looking for a robust VM backup solution? Try Vinchin Backup & Recovery!↘ Download Free Trial

Proxmox Backup VM Command Line refers to the function of performing virtual machine backups on Proxmox virtualization platform using the command line interface. By running the corresponding commands in the terminal or command line interface, you can easily perform backup operations for virtual machines, providing administrators with a convenient and flexible management tool.

Benefits of Proxmox backup VM command

Utilizing the Proxmox backup VM command feature for virtual machine backups brings numerous advantages, including but not limited to the following:

Automatic Scheduling: Easily set up and perform regular VM backups via Proxmox backup VM command line to reduce the risk of data loss.

Customizable Policies: Use Proxmox backup VM command to flexibly customize backup schedules and adjust parameters such as backup time and frequency to meet specific business needs.

Efficient Storage: Optimize storage through incremental backup, minimize stored data and improve backup efficiency.

Fast Recovery: Quickly recover virtual machines through Proxmox backup VM scripts to minimize downtime and ensure business continuity.

In Proxmox, you can use 2 methods to backup Proxmox VMs via the command line: via the Shell and via the WinSCP.

How to perform Proxmox VM backup using Shell command?

To perform Proxmox backup VM command in Shell, following these steps:

1. Login to Proxmox VE page

2. Click host > choose Shell

Proxmox VM backup using Shell command-1

3. Use the qm list command to view the ID of a virtual machine

qm list

Proxmox VM backup using Shell command-2

Proxmox VM backup using Shell command-2

4. Check the available storage IDs with the pvesm status command

Proxmox VM backup using Shell command-4

5. Use the vzdump command to back up the VM. This will create a backup file where <compression format> can be gzip, lzo, etc. and <storage ID> is the ID of the backup storage.

vzdump <VM ID> --compress <compression format> --storage <storage ID>
vzdump 23232 --compress gzip --storage local

Proxmox VM backup using Shell command-5Proxmox VM backup using Shell command-6

How to backup Proxmox VM with WinSCP command?

With WinSCP, you are able to establish a secure SCP or SFTP connection to a remote server and execute Proxmox Backup VM commands directly in the same user interface. This integrated design not only simplifies the operation process and reduces the need to switch between different tools, but also improves the efficiency of the overall operation.

To perform Proxmox backup VM command line in WinSCP, following these steps:

1. Double - click WinSCP, enter the Host name, User name, password > click Login

backup Proxmox VM with WinSCP command-1

2. Open terminal > hit OK

backup Proxmox VM with WinSCP command-2

3. Type the following Proxmox backup VM scripts > hit Execute

vzdump 23232 --compress gzip --storage local

backup Proxmox VM with WinSCP command-3

How to use scripts to restore the Proxmox VM backup?

After learning how to perform a VM backup using Proxmox backup scripts, if you need to  restore the backup, you can follow the natural steps below to restore a VM.

1. In Proxmox VE, the default VM backup directory is usually /var/lib/vz/dump/. You can use the cd command to switch to the backup directory:

cd /var/lib/vz/dump/

use scripts to restore the Proxmox VM backup-1

2.  Continue with the ls command to see a list of backup files in that directory to make sure you've found the correct backup file.

ls

use scripts to restore the Proxmox VM backup-2

3. Use the command to restore this backup to the appropriate virtual machine

qmrestore /path/to/backup-file.vma [new_vm_id]
qmrestore /var/lib/vz/dump/vzdump-qemu-23232-2023_12_27-14_33_10.vma.gz 300

use scripts to restore the Proxmox VM backup-3

use scripts to restore the Proxmox VM backup-4

How to backup Proxmox VMs with Vinchin?

Although using scripts for Proxmox VM backup is an easy way. However, in business-critical environments, a professional backup solution is highly recommended to ensure data integrity and reliability.

Vinchin Backup & Recovery is a powerful backup solution designed specifically for virtual machines on various platforms such as Proxmox, VMware, Hyper-V, XenServer, XCP-ng, oVirt, RHV, etc. Vinchin provides a rich set of features including V2V migration, disaster recovery, etc. to effectively manage critical data in virtualized environments. Vinchin provides comprehensive tools to ensure data integrity and security, giving you peace of mind in critical business scenarios.

Vinchin Backup & Recovery's operation is very simple, just a few simple steps. 

1. Just select VMs on the host

  backup Proxmox VMs with Vinchin-1

2. Then select backup destination 

 backup Proxmox VMs with Vinchin-2

3. Select strategies

 backup Proxmox VMs with Vinchin-3

4. Finally submit the job

 backup Proxmox VMs with Vinchin-4

Vinchin offers users a free 60-day trial where you can explore the full functionality of the software in a real-world environment. For more information, please contact Vinchin directly or one of our local partners. Please feel free to contact us to find out how Vinchin can meet your specific backup and recovery needs.

FAQ

Q1:How to create a VM snapshot using Proxmox command line?

A1: Yes, you can use the Proxmox command line to create a snapshot of a virtual machine via the qm snapshot command. For example, execute a command like "qm snapshot <vmid> <snapshot_name>". And if you need more command execution tasks, you can refer to Proxmox Scripts.

Q2: Is it possible to realize regular backup in Proxmox Backup VM script?

A2: Yes, regular automatic backup can be realized in Proxmox Backup VM script by using scheduled tasks.

Conclusion

Proxmox provides command line tools that enable administrators to efficiently perform VM backups via terminal commands. This feature offers advantages such as automatic scheduling, customizable policies, efficient storage and fast recovery. Users can choose to use either Shell or WinSCP as the two methods to execute Proxmox backup VM command line. In addition, consider using Vinchin Backup & Recovery professional backup solution for fast and efficient data backup and recovery operations.

Share on:

Categories: VM Backup
Free Trial Now close-icon