Proxmox Backup Server: Difference between revisions

From DWIKI
Line 6: Line 6:


=HOWTO=
=HOWTO=
==Create new backup repository==
 
===On PBS server:===
==Upgrade proxmox 6 to 7==
https://pve.proxmox.com/wiki/Upgrade_from_6.x_to_7.0
 
==Backup==
 
===Create new backup repository===
====On PBS server:====
  Datastore->Add Datastore
  Datastore->Add Datastore
New subdirectory will be created  
New subdirectory will be created  
Line 20: Line 26:




===On PBS guest:===
====On PBS guest:====
  Datacenter->Storage->Add->Proxmox backup server
  Datacenter->Storage->Add->Proxmox backup server
For "Datastore" enter the name as used on the PBS.
For "Datastore" enter the name as used on the PBS.
Line 29: Line 35:
  Backup->Add storage: your-pbs
  Backup->Add storage: your-pbs


==Remove PBS datastore==
===Remove PBS datastore===
  proxmox-backup-manager datastore remove yourdatastore
  proxmox-backup-manager datastore remove yourdatastore
this does not delete the data!
this does not delete the data!




==Move a PBS datastore==
===Move a PBS datastore===
  rsync -auv /mnt/datastore/old /mnt/datastore/new
  rsync -auv /mnt/datastore/old /mnt/datastore/new
  systemctl stop proxmox-backup-proxy
  systemctl stop proxmox-backup-proxy

Revision as of 13:01, 25 July 2022

 

Documentation

HOWTO

Upgrade proxmox 6 to 7

https://pve.proxmox.com/wiki/Upgrade_from_6.x_to_7.0

Backup

Create new backup repository

On PBS server:

Datastore->Add Datastore

New subdirectory will be created

Configuration->Access Control->User Management->Add

and

Configuration->Access Control->Permissions
Datastore->yournewstore->Permissions

to give the user access, Role is usually DatastoreBackup


On PBS guest:

Datacenter->Storage->Add->Proxmox backup server

For "Datastore" enter the name as used on the PBS. For fingerprint:

proxmox-backup-manager cert info | grep Fingerprint

Then:

Backup->Add storage: your-pbs

Remove PBS datastore

proxmox-backup-manager datastore remove yourdatastore

this does not delete the data!


Move a PBS datastore

rsync -auv /mnt/datastore/old /mnt/datastore/new
systemctl stop proxmox-backup-proxy
rsync -auv /mnt/datastore/old /mnt/datastore/new
vi /etc/proxmox-backup/datastore.cfg
systemctl start proxmox-backup-proxy

and after checking everything you can

rm -vf /mnt/datastore/old

PBS API

Create cookie

PBS=your.pbs.server
curl --silent --insecure --data "username=zabbix@pbs&password=n0tmyp4ss" https://$PBS:8007/api2/json/access/ticket | jq --raw-output '.data.ticket' | sed 's/^/PBSAuthCookie=/' > cookie

Test cookie

curl -XGET --silent -k -b $(cat cookie ) https://$PBS:8007/api2/json/

Recovering files from backup

export PBS_REPOSITORY=mypbs:mydatastore
proxmox-backup-client snapshot list

Output like: vm/109/2022-01-25T20:18:02Z │ 200.00 GiB │ client.log drive-ide0.img index.json qemu-server.conf

# proxmox-backup-client map vm/109/2022-01-25T20:18:02Z drive-ide0.img

Image 'data2:vm/109/2022-01-25T20:18:02Z/drive-ide0.img' mapped on /dev/loop0
# lsblk

NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0          7:0    0   200G  1 loop
├─loop0p1    259:0    0   251M  1 part
├─loop0p2    259:1    0   3.9G  1 part
└─loop0p3    259:2    0 195.9G  1 part

 

mount /dev/loop0p3 /mnt/loop/

mount: /mnt/loop: cannot mount /dev/loop0p3 read-only.

mount -o loop,ro,norecovery /dev/loop0p3 /mnt/loop/

and that should be it. After you're done:

umount /mnt/loop
proxmox-backup-client unmap /dev/loop0

 

TBD: explain how t o use kpartx and friends to acces LVM volumes

 

FAQ

error pruning backups - check log (500)

Possibly a permissions thing, which is good. Leave pruning to the backup server

Pending removals

proxmox-backup-manager garbage-collection status mystore


command error: http upgrade request timed out

??

Connection error - server offline?

This can also happen when you can actually connect to server:8007 Check

 systemctl status proxmox-backup


Connection error 401: No ticket

Browser issues, try clearing cache/cookies(?) or another browser.