Page MenuHomePhabricator

Netbox: replace CSV dump with more frequent DB dumps
Closed, ResolvedPublic

Description

The current CSV dump system is both hard on the host's resources (see the spikes), cumbersome to restore (see the lack of doc) and cumbersome to maintain (see the script).

We should instead explore doing a more frequent DB dump (eg. hourly) and rotating it the same way as the CSV dumps, for example hourly on the replica DB server and daily on the primary or similar.

Having a single efficient way to export and restore backup will greatly improve Netbox's overall reliability.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Historical context from Faidon:

the reasons back then were to be able to see what we lost by greping rather than having to restore for simpler problems or cases where we recycled hardware, deleted it from netbox, and deleted one piece of equipment too many etc.
but this was during a different time, where it wasn't that expensive to generate CSVs, and where we had less confidence (and also we didn't have a netbox-next to restore a backup quickly if need be, I guess?)

As additional data point I don't think anyone ever restored data from a CSV dump since we set it up, we usually do a DB restore and/or manual changes to catch up with valid changes that might have happened since the latest backup.

Change 821177 had a related patch set uploaded (by Ayounsi; author: Ayounsi):

[operations/puppet@production] Netbox: remove CSV dump directory and time

https://gerrit.wikimedia.org/r/821177

Change 821178 had a related patch set uploaded (by Ayounsi; author: Ayounsi):

[operations/puppet@production] Netbox: remove Puppet config related to CSV dumps

https://gerrit.wikimedia.org/r/821178

Change 821180 had a related patch set uploaded (by Ayounsi; author: Ayounsi):

[operations/software/netbox-extras@master] Remove CSV dump scripts

https://gerrit.wikimedia.org/r/821180

Change 821177 merged by Ayounsi:

[operations/puppet@production] Netbox: remove CSV dump directory and timer

https://gerrit.wikimedia.org/r/821177

Change 821178 merged by Ayounsi:

[operations/puppet@production] Netbox: remove Puppet config related to CSV dumps

https://gerrit.wikimedia.org/r/821178

ayounsi claimed this task.

CSV dumps removed and doc updated.

Change 821180 merged by Ayounsi:

[operations/software/netbox-extras@master] Remove CSV dump scripts

https://gerrit.wikimedia.org/r/821180