Add import/export (backup/restore) for settings (non-settings data not required)
I have found these related issues/pull requests
This might be a lot easier if the following issue was also addressed:
Related but quite different:
️ Feature Request Type
Settings
Feature description
It'd be nice if it were possible to import/export (backup/restore) uptime kuma settings. I'm not talking about the entire DB and all the data uptime has collected, just the settings; i.e. the monitors, the status pages, and the settings page.
Ideally this would be in a human-readable format, as it would make mass-editing of monitors as simple as export to json (or whatever file format is used), edit, then import. One distinct advantage of it being human-readable would be that it'd be a lot easier to merge instances, or split instances, should such a need ever arise.
✔️ Solution
Provide a user friendly method of importing/exporting settings.
There are multiple methods of doing this, though I think the best method would be implementing #2496 (splitting settings out of the main database so that it is distinct from the rest of the database). Doing so would allow users the most basic of import/exports, backing up the split-out settings file (ideally the resulting settings file would be human readable, like json, but even as a distinct database that'll be better than it is now)
❓ Alternatives
Provide a backup/restore UI option that imports/exports only the settings, not the data generated by the monitors.
Additional Context
Benefits:
- Backup/Restore: Right now the best backup/restore option available is periodically copying all the data to another directory. This is functional, but there are reasons so many programs out there provide a method to backup/restore independent of having the user backup from / restore to the underlying file system. Providing this method would enable backup/restore of settings, which is the important bit for me at least.
- Version Control for Settings: Users could version control (
git) their uptime kuma settings. Right now, since everything is stored together,gitwould constantly complain that something has changed as uptime kuma collects and stores it in the database. This basically nullifies any benefit of usinggitover periodically copying all the files to a date-labeled folder. - Mass Editing of Settings: If the exported settings are human readable, it could be very useful if, for example, a user needs to do a find-and-replace across all monitors. For example, say some IP address changed and multiple monitors need that updated. With this feature, updating everything could be as simple as: export,
sed -i 's/old_ip/new_ip/g' settings.json; then import. - Merging / splitting instances: On multiple occasions I've needed to either split a single uptime kuma instance into two (such as moving some services to a new machine and needing to setup a new uptime kuma instance with all the relevant monitors migrated from the existing one) or merge multiple instances (such as when consolidating servers and wanting to consolidate the uptime kuma instances / monitors into one). If the exported settings were easily editable, this would be a trivial action.
Source: louislam/uptime-kuma