Skip to content

Adding support to SQLite - #3

Open
emmkay440 wants to merge 1 commit into
Hexay:synapse-importfrom
emmkay440:synapse-import
Open

emmkay440 wants to merge 1 commit into
Hexay:synapse-importfrom
emmkay440:synapse-import

Conversation

@emmkay440

Copy link
Copy Markdown

Hi, I was working on a python tool to perform the database migration but I noticed your approach is generally better using tuwunel's own import modules.
Altough I didn't go the postgres route the changes create an interface shared between both postgres and my db of choice, sqlite.
I just performed my own server migration and it did great, I missed only empty rooms but that's to be expected as they are handled differently between projects, but I also should mention I am not federated, so anything regarding federation wasn't fully tested and may need more tests.

It work similar to postgress --import-synapse and --synapse-db now support sqlite.
source.rs was split into multiple files in order to create an interface to support both dbs.
media keeps creation time and is integrity checked.
accounts awaiting approval could be logged into, they are moved to locked and need admin approval to unlock.

…undle importer did

--synapse-db takes a SQLite database file as well as a PostgreSQL
connection string. The file is opened read-only and immutable, and the
import refuses while a -wal or -journal beside it holds changes. Rows from
either database come back as one row type; queries are written in SQL both
understand, with a variant where they differ (table and column lookups, the
to-device stream position). MAS stays PostgreSQL only.

Also, as the bundle importer did:
- erased users are marked erased, not only their events pruned
- accounts waiting for approval are locked instead of left open
- account types and consent versions are reported as not kept
- devices keep Synapse's last-seen time and address
- media is checked against Synapse's recorded size and SHA-256, keeps its
  upload time on local storage, and files the database doesn't list are
  reported
- Synapse 1.164 (schema 95) is accepted
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.

1 participant