Currently we're performing Postgresql backups of Netbox, but if a wrong edit is made it would be pretty hard to manually find the right values for a quick revert without having to restore the whole DB, potentially losing changes made by others.
We could, in addition to the DB backup, also perform backups in CSV form of the data, using the export to CSV function in Netbox.
A script in the netbox-deploy repo, that uses the already existing token should do the job and should be fairly simple to add.
Caveat: for the DCIM devices we should use the custom export all fields CSV method instead of the default one.
Things to be decided:
- which objects to export (all?)
- how frequent to perform the backup
- in which structure
- For this my suggestion would be something like:
netbox-csv-backups/ 2019-05-14/ dcim.devices.csv dcim.sites.csv ....
- how/when to rotate/compress the files