Skip to content

Proxmox Backup Server: move snapshots to new or existing namespaces

Abstract

This guide explains how to migrate snapshots to new or existing namespaces within Proxmox Backup Server (PBS)


Pre-Requisites


Steps to Move Namespaces

1. Stop Backup Jobs

Before proceeding, stop any backup jobs. This prevents conflicts during the migration.

  1. Go to the dashboard in PBS.
    pbs-setup
  2. Identify jobs targeting the namespace.
  3. Stop or temporarily disable these jobs.

2. Create a new namespace

  • Go to Datastore > Content > Add namespace in the PBS interface. I have named my new namespace "falador_snapshots_local"
    pbs-setup

3. Moving snapshots to the new or existing namespace

  1. Open a shell on PBS
  2. Navigate to your datastore:
    cd /mnt/datastore/<YourDatastoreName>
    
    pbs-setup

All snapshots are currently not in a namespace will be under the folders /ct (container) and /vm (virtual machine). If you are already using namespaces, these snapshots will be under the folder /ns

  1. To move the snapshots to your new namespace, you can use a simple move (mv) command. Example:

mv ct ns/falador_snapshots_local/
mv vm ns/falador_snapshots_local/ 
In the example above I was not using a namespace before.

Info

This move will be instant, as it will only changes the pointers to the data.

3. Make Proxmox Virtual Environment (PVE) aware of the move

Now we need to fix the link in PVE. As the PVE instance currently does not know that its snapshots have been moved to a new namespace Below a screenshot that the backups are not visible for the container 'Samba'.
pbs-setup

Sadly we can't fix this from the GUI currently. But the fix is easy enough through the cli.

  1. In PVE, open a shell
  2. Navigate to the storage config:
    nano /etc/pve/storage.cfg
    
    pbs-setup
  3. Add at the bottom "namespace" + "the name of your namespace"
  4. Save and exit
  5. Restart the necessary services to apply the change:
    systemctl restart pvedaemon pveproxy 
    

Now we go back in PVE to the backups of our vm's and ct's, we should our backups again (make sure you select the correct storage): pbs-setup