Two stores exist. The API keeps a backup of agent settings and rules. The files on disk are copied by hand before an OS upgrade.
A backup is created automatically when Nginx, Filter, or MLC settings change and when an request processing rule, a response processing rule, the block list, the machine-learning host list, the API Firewall settings, or data masking change. It is also created when a behavioral model is generated, replicated, or deleted. A manual copy is set_%ENTITY% with a comment. Restoring writes a backup of the current state first.
The storage period is RB_STORAGE_PERIOD in the API configuration. The value 0 means backups are not created. Methods for response processing rule and for the Scanner settings are on the Enterprise plan.
The entities and the get, set, del, diff and restore methods are Backup of Mikiri WAF agent settings. diff is the comparison of a stored copy with the current settings.
Call restore_%ENTITY% for the entity that changed: erl for request rules, rprl for response rules, filter_settings for Filter options, nginx_settings for hosts and certificates, models for a behavioral model. The entity names are on that page. Restoring one entity does not replace the others.
A downloaded copy of nginx_settings masks private keys and DHParam. Restore from a copy that still has the keys, or install the certificate again in WMC.
Before an OS or package upgrade, copy the configuration files listed in Main configuration files. Docker volumes keep the working configuration. After an image update the previous files are in old/ on that volume. See Docker images.
A standby PostgreSQL keeps a copy of the API database and serves reads while the primary API is down. Building that copy is Fault-tolerant operation of API. Moving an agent to a new server without placing one Filter key on two servers is Moving an agent to a new server.