Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update administration.md #194

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Conversation

ChillyKitty
Copy link

Added more administration guidance and information.

Added more administration guidance and information.
After getting the room id you can clear out messages stored on your server since this is not done automatically. In the example below our room id is 1 and messages older than 14 days are being deleted.
```
sqlite3 /var/lib/session-open-group-server/sogs.db "DELETE FROM message_details WHERE room = 1 AND posted < strftime('%s', 'now', '-14 days');"
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better query here would be this so that you don't have to worry about the ID values at all:

DELETE FROM message_details WHERE room = (SELECT id FROM rooms WHERE token = 'someroom') AND posted < strftime('%s', 'now', '-14 days');

However, in general, I'd prefer that we moved such functionality into the sogs command-line tool as I'm rather wary of having people directly interact with the sqlite database.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, was saying this in the Session SOGS group. I'll look into it.

@jagerman
Copy link
Member

Backup for a SOGS using postgresql instead of SQLite would need a separate dump of the database via:

pg_dump -Fc sogs >pysogs_db_backup_$(data --iso-8601).pgdump

alongside the tar file from the sqlite instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants