database-save.sh 362 B

123456789101112131415
  1. #!/bin/sh
  2. # This script will write a dump file of local user state if you want to splat
  3. # your entire server database and start again but preserve the identity of
  4. # local users and their access tokens.
  5. #
  6. # To restore it, use
  7. #
  8. # $ sqlite3 homeserver.db < table-save.sql
  9. sqlite3 "$1" <<'EOF' >table-save.sql
  10. .dump users
  11. .dump access_tokens
  12. .dump profiles
  13. EOF