Ability to create a local backup

Feature description
Hello,

There is currently automatic backup via Gladys Plus but it could be useful to be able to manage your home automation setup without Gladys Plus, which should remain optional (even though I understand that it’s THE source of Gladys’s revenue), otherwise Gladys would no longer be a free solution.

I think a local backup feature would be interesting.

A place where you can save or import a backup.

When I started with Gladys, I asked myself the same questions. It was in this discussion: Solutions de sauvegarde / Backup Raspberri Pi

And then afterwards, I chose the comfort of Gladys Plus :wink:

1 Like

Hi @McFlyPartages :slight_smile:

As such it’s already very easy to make a manual backup — in Gladys everything is stored in a SQLite database (so a single file)

On disk it’s available at:

/var/lib/gladysassistant/gladys-production.db

(The path may change depending on the Docker volume you set at creation)

You can easily make a script that stops Gladys:

docker stop gladys

Then make a backup of the DB with a tool like rclone

Then restart Gladys:

docker restart gladys

Also, I agree that a button in the interface « Download the database » could be handy — depends if there’s demand for that :slight_smile:

4 Likes

[quote=« pierre-gilles, post:3, topic:8840 »]
As such it’s already very easy

2 Likes

I’m just following up on this request, which would be really useful.

A proposal by Claude:

My test version is well saved and the reload also works.

However, this is a complicated process, so I’m not sure everything is OK on the non-visible side.

Code: Comparing GladysAssistant:master...Hizoka76:feat/local_save_and_load · GladysAssistant/Gladys · GitHub

3 Likes

It’s necessary to use the existing method and bypass the transfer or restoration of Gladys. But I’m not sure if PG will agree, as this would remove the interest in Gladys Plus and its backup, right? :face_with_peeking_eye::thinking:

Yes, this would remove some of the interest in saving with Gladys Plus.
Otherwise, a button to download the backup made via Gladys Plus would be needed.

I don’t think this removes the interest in backing up Gladys Plus. With Gladys Plus, you have a daily backup with restoration from an external server.

You won’t lose your config if your PC or disk crashes, and that’s the main advantage.

If you have to do it manually, then it’s your responsibility if your PC crashes or if you lose your backup.

You should also ask yourself why you’re taking the subscription. For me, auto backup isn’t the most important point, but rather remote access.

To conclude, not everyone has the means/needs to take Gladys Plus, but on the other hand, backing up/restoring your configuration is, in my opinion, a basic feature.

2 Likes

I’m far from being against the idea, quite the opposite. But I think we might have discussed this at some point and it was abandoned :thinking:

It’s possible my memory is playing tricks on me :sweat_smile::rofl:

Yes, in this case, I think it’s pretty cool to be able to download the database and restore it in the interface, so no problem for me :slight_smile:

It would even be very useful for testing Docker image builds with a production database.

However, this is a sensitive process that must be developed carefully. AI can help with the interface, but the business logic of backup and restore must be well unit-tested and rigorously reviewed.

2 Likes

Yes, currently I’m doing backups on the fly,

docker stop gladys
cp /var/lib/gladysassistant/gladys-production.db /var/lib/gladysassistant/gladys-save-26-05-08.db
docker start gladys

And as for the AI code, I haven’t looked at it, so I have no idea if it’s clean, it was really just a suggestion.

Because yes, this is an extremely sensitive point that must be absolutely flawless.