NetBox Restoration Guide
Introduction
The restore process works by taking a backup generated by the NetBox Backup, decrypting it, and restoring it. Check the NetBox Development Snapshots section in the backup guide for an approach on using this feature for dev/test.
The ENCRYPTION_KEY
value in the NetBox Backup Settings Semaphore environment is used in both the backup and restore process. Be sure to keep track as if you change it on the target system, all future backups will use the new key.
Configure the Restore
The NetBox backup process will create three timestamped (mm_dd_yyyy_HH_MM
) files like these. The enc
files are encrypted using the ENCRYPTION_KEY
variable.
netbox_db_03_18_2024_01_00.sql.gz.enc
netbox_media_03_18_2024_01_00.tar.gz.enc
netbox_status_03_18_2024_01_00.json
You can manually decrypt the files using the command openssl enc -aes-256-cbc -d -in BACKUP_FILE.enc -out OUTPUT.sql.gz.tar.gz
The restore file prefix is set in the NetBox Backup Settings environment and is the timestamp used for all three files. Set this to match the timestamp of the files that you place in the /netos/netbox/backups
directory.
Plugin Version Validation Logic
By default, when the backup runs it will check the NetBox version and plugin versions of the target system by comparing the output of the /api/status
endpoint collected from the backup with the version of the target system.
This is an example of the relevant JSON:
"netbox-version": "3.7.8",
"plugins": {
"netos": "1.4.6",
"netos_fabric": "1.3.3",
"netos_model_builder": "1.2.37",
"netos_reporting": "1.3.16"
}
In the event of a mismatch, you will see a warning like this that details the discrepancies between the backup and target system.
To disable this check, change BYPASS_PLUGIN_CHECK
to Yes
. Disabling may be acceptable when restoring to a slightly different target system, for example, where the Netos Insights plugin has increased from minor version 1.2.24
to 1.2.26
.
When BYPASS_PLUGIN_CHECK
is set to Yes
the restore process will look like this:
Any NetBox Open Source Plugins or Netos Enterprise NetBox Plugins installed using Semaphore will be named according to their version and saved in /netos/working-dir/netbox-plugins
and /netos/working-dir/netos-plugins
. The /netos/working-dir
directory is backed up each day, assuming you enable the schedule in Semaphore.