Created
December 20, 2019 17:48
-
-
Save maakuth/b5d58d4aa5b0fdbb3590a5c0b8017f12 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
rooms = `sudo -u postgres psql synapse -t -c "select room_id from rooms;"`.split("\n") | |
rooms.reject! {|r| r.strip == "" } | |
rooms.each_with_index do |r, i| | |
`./synapse-compress-state -p 'postgresql://USERNAME:PASSWORD@HOSTNAME/DBNAME' -r '#{r.strip}' -o out#{i}.sql -t` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Leaves you with a number of
out[number].sql
-files. You can apply them viasudo -u postgres psql synapse < *.sql
No warranty for any stuff you copy paste out of random gists, obviously ;)