3x-ui/database
MHSanaei a07c7b7f4e
feat(migrate-db): SQLite <-> .dump conversion and Download Migration in Overview
Binary: extend the migrate-db subcommand with --dump and --restore so a
SQLite database can be exported to a portable SQL text dump and rebuilt from
one, alongside the existing --dsn PostgreSQL copy. Implemented in Go via the
bundled sqlite driver (new database/dump_sqlite.go); no external sqlite3 client
is required. Add ExportPostgresToSQLite (reverse of MigrateData) to build a
SQLite .db from live PostgreSQL data, reusing the shared copyAllModels helper.

Overview: add a "Download Migration" item to Backup & Restore plus a
getMigration endpoint/service that returns a .dump on SQLite or a .db on
PostgreSQL, so the data can seed a panel on the other backend. Document the
endpoint in api-docs and translate the three new strings across all locales.

Tests: cover the destination-side copy (AutoMigrate + copyTable into SQLite)
and the dump/restore round-trip including quoted values. Ignore *.dump.

The x-ui.sh helper that drives this from the CLI is in PR #4910.
2026-06-04 15:32:22 +02:00
..
model fix(api-token): hash tokens at rest and show plaintext only once 2026-06-03 22:57:50 +02:00
db.go fix(api-token): hash tokens at rest and show plaintext only once 2026-06-03 22:57:50 +02:00
db_seed_test.go feat(inbounds): support Unix domain socket path in Listen field (#4429) 2026-06-02 00:37:20 +02:00
dialect.go fix(nodes): use GREATEST for last_online merge on PostgreSQL 2026-05-29 02:04:02 +02:00
dump_sqlite.go feat(migrate-db): SQLite <-> .dump conversion and Download Migration in Overview 2026-06-04 15:32:22 +02:00
dump_sqlite_test.go feat(migrate-db): SQLite <-> .dump conversion and Download Migration in Overview 2026-06-04 15:32:22 +02:00
migrate_data.go feat(migrate-db): SQLite <-> .dump conversion and Download Migration in Overview 2026-06-04 15:32:22 +02:00
migrate_data_test.go fix(migrate-db): preserve false-valued columns in SQLite to Postgres copy 2026-06-03 14:28:14 +02:00