Managing the PSM catalog

The PSM stores information about every object that is backed up in a catalog for later reference and been able to locate the objects.

The catalog is stored in the directory pointed by the configuration parameter PSM_CATALOG_PATH. It consists a set of files that represent tables and indexes. The tables are in binary format and you cannot access or modify its information directly. The only supported way to access the catalog is using the different options of the onpsm command utility.

If the catalog is lost, access to the backed up objects becomes impossible. If this situation happens, you have the following options:
  1. Since the PSM catalog consist of regular operating system files, you can restore those files if you have a recent file system backup. The backup must be taken while the PSM catalog was not being used.
  2. You can import a catalog export generated with the onpsm utility (action export in the catalog (-C) menu).
  3. You can restore a catalog backup, generated with the onpsm utility (action backup in the catalog (-C) menu).
Attention: Any objects created after the catalog was backed up or exported will not be present in the catalog and therefore will not be restorable. In order to make those objects restorable, you need to scan the PSM devices to add any additional objects.

If you do not have any suitable copy/backup of the catalog you can scan the devices, however scanning the devices is a potentially slow operation and it preferably to use it to add a few objects after the restore instead of scanning every single object.

Catalog backup

A new functionality to backup/restore the catalog was introduced in OneDB 1.0.1.0. This option allows you to generate a backup to a single file that contains a JSON representation of the PSM catalog.

The catalog backup can be stored in a local file in the machine:

onpsm -C backup /home/onedb/psm/catalog_backup/psm_catalog.json

Or to a suitable cloud location (Currently only S3), if using a cloud location, you must provide the information about how to connect to the cloud location in a keystore generated with the onkstore utility:

onpsm -C backup https://mybucket.s3.amazonaws.com/dir1/psm_catalog.json --creds /home/onedb/keystores/psm_s3.p12

If the PSM_CATALOG_BACKUP configuration parameter is set, the PSM will automatically backup the catalog every time that a new device is added. Also the onbar script contains logic to detect that the parameter is set and, in that case, start a catalog backup every time that a level 0 backup is performed.

If the PSM_CATALOG_BACKUP configuration parameter is set, the PSM will automatically restore the catalog if the catalog does not exists. IF the catalog is restored, the default devices will not be created if they did not exists in the original catalog.