uptime-kuma icon indicating copy to clipboard operation
uptime-kuma copied to clipboard

Backup and restore without GUI

Open mabed-fr opened this issue 2 years ago • 4 comments

⚠️ Please verify that this bug has NOT been raised before.

  • [X] I checked and didn't find similar issue

🛡️ Security Policy

📝 Describe your problem

Backup and restore without GUI

Hello, I would like to create a task to backup my main uptime Kuma without the GUI and restore it in another instance, all in CLI if possible.(for sync the probe)

Is this possible?

Regards

🐻 Uptime-Kuma Version

Version: 1.11.3

💻 Operating System and Arch

Debian 11

🌐 Browser

Version 96.0.4664.110 (Build officiel) (64 bits)

🐋 Docker Version

Docker version 20.10.12, build e91ed57

🟩 NodeJS Version

docker image

mabed-fr avatar Feb 04 '22 23:02 mabed-fr

would like to see this option

AlexanderSalge avatar Feb 25 '22 14:02 AlexanderSalge

adding a +1 on that. I think as a first implementation, having an API Endpoint to get a backup would suffice being able to save that configuration

PixelJonas avatar Apr 12 '22 10:04 PixelJonas

Also would like to see this. Maybe a menu where you can generate and remove API tokens so only valid tokens can get the data. Then you could execute something like a curl command for something like automatic backups

curl -X POST https://status.domain
   -H 'Content-Type: application/json'
   -d '{"login":"my_login","key":"api_key"}'

jamolnng avatar Jun 06 '22 20:06 jamolnng

We have two uptime kuma servers. One is basically just a backup server at an offsite location. The ability to manage our main server and have a cronjob automate the notification and monitor syncing to the backup server would be extremely useful.

c0nfus3d avatar Jul 19 '22 17:07 c0nfus3d

We are clearing up our old issues and your ticket has been open for 3 months with no activity. Remove stale label or comment or this will be closed in 2 days.

github-actions[bot] avatar Oct 17 '22 18:10 github-actions[bot]

This issue is still relevant in my opinion...

pascaliske avatar Oct 17 '22 18:10 pascaliske

No i want this feature

mabed-fr avatar Oct 17 '22 18:10 mabed-fr

+1 for /remove-stale having being able to have automatic backup would be a game changer

PixelJonas avatar Oct 17 '22 19:10 PixelJonas

We are clearing up our old issues and your ticket has been open for 3 months with no activity. Remove stale label or comment or this will be closed in 2 days.

github-actions[bot] avatar Jan 16 '23 06:01 github-actions[bot]

I wait this feature with the API

mabed-fr avatar Jan 16 '23 07:01 mabed-fr

Also think this is an important feature.

boc-the-git avatar Jan 16 '23 10:01 boc-the-git

After more than a year came back to see if automated / scripted config import is available, sadly not it seems? 😢

Am I currectly understanding that its not possible to load a config backup at startup (preferably docker container)?

Would not need a fully fledged rest api with tokens and whatnot, a file mounted to the container would suffice for us.

This keeps us from using uptime-kuma since it has to be deployable as easy as possible, from a git version-controlled committed default configuration (complete monitoring stack prometheus, grafana, loki, ........). Having users at the customer site manually import some config is tedious and error prone.

Has anybody hacked something together to support this?

Mario-Hofstaetter avatar Feb 13 '23 09:02 Mario-Hofstaetter

All the application data is currently stored in an SQLite file, which can be mounted as docker volume as per setup instructions. If you have no security requirements you can just setup once then copy the database on deployment.

chakflying avatar Feb 13 '23 10:02 chakflying

You can use this command safely while the service is running:

sqlite3 data/kuma.db ".backup '/backups/kuma.db'"

thomas-mc-work avatar Feb 13 '23 13:02 thomas-mc-work

We are clearing up our old issues and your ticket has been open for 3 months with no activity. Remove stale label or comment or this will be closed in 2 days.

github-actions[bot] avatar May 14 '23 18:05 github-actions[bot]

This issue was closed because it has been stalled for 2 days with no activity.

github-actions[bot] avatar May 17 '23 00:05 github-actions[bot]

I was able to extract a compressed data folder from the uptime-kuma local repo using scp Secure Copy Protocol.

First cd into the uptime-kima directory. Then compress the data folder using:

tar -zcvf ~/backups/kuma-data.tar.gz data/

This will compress everything in the data folder and save as kuma-data.tar.gz in ~/backup/

If you want to copy it onto a remote machine use the scp command from the remote machine. Make sure that the uptime-kuma host machine have SSH enabled:

scp [email protected]:~/backups/kuma-data.tar.gz ~/tools/backups

Replace pi with the user and raspberrypi.local with the IP of the host machine respectively.

baharalidurrani avatar Sep 28 '23 15:09 baharalidurrani