matrix-org / conference-bot

The conductor for your orchestra^Wconference
Apache License 2.0
44 stars 7 forks source link

Backup/restore conference DB room #3

Open turt2live opened 3 years ago

turt2live commented 3 years ago

There's a room which stores all the conference bot data: there's no way to back it up or restore it if something were to go wrong.

postgresql would probably make the most sense for us, but sqlite makes it easier to deploy

Related issue: https://github.com/matrix-org/conference-bot/issues/52

reivilibre commented 1 year ago

Especially now that this room is used for fewer purposes (possibly just 3PID overrides for people), I'm struggling to understand whether this is sufficiently useful.

To back up or restore a room is something you can do already at the Synapse database level, or using the Matrix API. (Even Element Web has an 'export room' to JSON function, which could conceivably be used.) It's not as though the bot will redact previous state events (?) so we can likely pull anything out from history again if we need to.

turt2live commented 1 year ago

it was a mistake to use a Matrix room in the first place, tbh. In 2021 we were concerned about the conference bot corrupting the room state on its own, leading to an unrecoverable state even if a server backup was taken - the idea was to back up the DB room before the conference starts, then periodically throughout the conference.

reivilibre commented 1 year ago

For this year I suggest we use Element Web's export feature to take dumps of the little remaining content that is still stored in the database room. The alternative would be to add a command to the bot that produces a JSON attachment or something, but sounds yucky. For restoring the room, we likely want to have a script ready to take Element Web's export and send the state back into the room. This is probably very easy to put together with any Matrix SDK of choice.

turt2live commented 1 year ago

I don't think the export counts custom (state) events? I'd suggest a cron job that just scrapes current_state_events every 4 hours or something

reivilibre commented 1 year ago

agh, it doesn't do custom state events indeed, boo :(