Migrate from a self-hosted server
Guided todayMove PostgreSQL, TimescaleDB, MySQL and 13 more engines from a self-hosted server into a Databasezy instance. For PostgreSQL and MySQL, continuous sync (coming soon) keeps the copy current so the switch takes seconds.
Moves into
What moves
PostgreSQL
- Schemas, tables, indexes, constraints and views
- Functions, triggers and sequences, with sequence values checked after the copy
- Extensions we ship; any we do not are named in the preflight
- Roles and grants are listed; new credentials are issued for the target
TimescaleDB
- Schemas, tables, indexes, constraints and views
- Functions, triggers and sequences, with sequence values checked after the copy
- Extensions we ship; any we do not are named in the preflight
- Hypertables and their chunks
- Roles and grants are listed; new credentials are issued for the target
MySQL
- Databases, tables, indexes and foreign keys
- Views, stored procedures, functions and triggers
- Users are listed; new credentials are issued for the target
MariaDB
- Databases, tables, indexes and foreign keys
- Views, stored procedures, functions and triggers
- Users are listed; new credentials are issued for the target
Valkey
- Every key in every logical database, with its TTL
- Strings, hashes, lists, sets, sorted sets and streams
- Lua scripts and module-backed keys are listed for you to review
Redis (compat)
- Every key in every logical database, with its TTL
- Strings, hashes, lists, sets, sorted sets and streams
- Lua scripts and module-backed keys are listed for you to review
MongoDB (Percona Server)
- Databases, collections and documents
- Indexes, including unique and TTL indexes
FerretDB (MongoDB-compatible)
- Databases, collections and documents
- Indexes, including unique and TTL indexes
- Queries or indexes FerretDB does not support are named in the preflight
ClickHouse
- Tables recreated from SHOW CREATE TABLE; replicated and Cloud engines become MergeTree
- Rows streamed table by table in ClickHouse Native format, then views
InfluxDB 3
- Tables or measurements with their time-series data
- Tags, fields and designated timestamps
QuestDB
- Tables or measurements with their time-series data
- Tags, fields and designated timestamps
Meilisearch
- Indexes, documents and index settings
- Ranking rules, synonyms and stop words where an equivalent exists
Qdrant
- Collections, points and vectors
- Payloads and payload indexes from snapshots
Weaviate
- Collections, objects and vectors
- Schema and module settings
CouchDB
- Databases and documents
- Design documents and views
TypeDB
- Schema and data through TypeDB 3 database export and import
Preflight checklist
The preflight checks these for you and shows the result before anything is copied. Knowing them up front saves a round trip.
Specific to Self-hosted server
- Servers behind a firewall can be migrated with zb migrate --from local, which needs no inbound port (Postgres, TimescaleDB, MySQL, MariaDB, Redis, Valkey and MongoDB).
- ClickHouse is copied table by table (SHOW CREATE TABLE, then SELECT ... FORMAT Native); Replicated and ClickHouse Cloud Shared table engines become MergeTree.
- TypeDB needs the database named in the URL (typedb://user:password@host:1729/<database>) and TypeDB 3.11 or newer on both sides (the migration's TypeDB Console 3.13 and servers before 3.11 refuse each other).
For every source
- Allow the migration egress addresses shown in the portal through any firewall or IP allow-list.
- Use a connection with TLS. The preflight reports if it cannot verify the source certificate.
- For continuous sync on Postgres, the source needs wal_level=logical. For MySQL, binlog_format=ROW and a replication user.
- Pick a target engine version at least as new as the source.
- Check that the target size has room for the estimate, plus indexes rebuilt during restore.
Step by step
-
Get a connection string
Use a user that can read every table you want to move, and allow our migration egress addresses through your firewall.
-
Run the preflight
Start a migration from the Migrate in tab of the target instance, or from the CLI. The preflight connects, detects the engine and version, and checks for anything that will not carry over.
Terminalzb migrate --from "postgres://<user>:<password>@<host>:5432/<database>" --to inst_abc -
Review the estimate
The preflight reports size, the target size and storage it recommends, and how long the copy should take. Pass --create to the CLI to provision a target sized from it.
-
Copy
Engine-native tools copy the data inside your target's cell. Progress shows per table, collection or key count in the portal and the CLI.
-
Verify
Row counts, sampled checksums, schema, sequences and indexes are compared. Any mismatch is listed in the result before you switch.
-
Keep it in sync, then cut over
Leave continuous sync running while you test against the new instance. When the lag shown in the portal is near zero, switch your app's connection string and run the cutover. It stops replication and resets sequences. Continuous sync and cutover are coming soon; until then, switch during a short maintenance window.
Terminalzb migrate cutover mig_123
How the pipeline runs for this source
- Step 1: Preflight
Connects, detects the engine and version, estimates size and duration, and lists anything we cannot carry over.
- Step 2: Copy
Runs the engine's own dump and restore tools inside your target's cell, with live progress per table or collection.
- Step 3: Verify
Compares row counts, sampled checksums, schema, sequences, indexes and extensions. Mismatches are listed, not hidden.
- Step 4: Sync
Optional for Postgres and MySQL: replication keeps the copy current while your app still writes to the source.
- Step 5: Cut over
You point your app at the new connection string. With sync running, the switch takes seconds.
- Step 6: Report
Durations, sizes, verification results and skipped objects, saved to the audit log and emailed to you.
Sync and access
Supported for PostgreSQL and MySQL, coming soon
After the first copy, logical replication or binlog replication keeps the target current while your app still writes to Self-hosted server. You switch when the lag is near zero, then run the cutover. Continuous sync is part of the Solo plan and above.
TimescaleDB, MariaDB, Valkey, Redis (compat), MongoDB (Percona Server), FerretDB (MongoDB-compatible), ClickHouse, InfluxDB 3, QuestDB, Meilisearch, Qdrant, Weaviate, CouchDB, TypeDB: one-time copy only, so plan a short maintenance window.
Ways to read the source
- Connection string (default)
- A migration job in your target's cell connects out to the source over TLS.
- CLI from your machine
- The zb CLI runs the engine's dump tool on your machine and streams the result. No inbound port.
With the CLI
Every method has a zb migrate form. Replace the placeholders with your own values.
zb migrate --from "postgres://<user>:<password>@<host>:5432/<database>" --to inst_abczb migrate --from local --engine postgres --db myapp --to inst_abczb migrate status mig_123
zb migrate cutover mig_123Further reading
- zb migrate CLI guide Exact settings, and the versions it was tested with.
- PostgreSQL on Databasezy Versions, connection strings and backups.
- TimescaleDB on Databasezy Versions, connection strings and backups.
- MySQL on Databasezy Versions, connection strings and backups.
- MariaDB on Databasezy Versions, connection strings and backups.
- Valkey on Databasezy Versions, connection strings and backups.
Related sources: Anywhere else
- Guided today
Local files and dumps
Moves into:
- PostgreSQL
- TimescaleDB
- MySQL
- MariaDB
- +8 more
- Guided today
Docker container
Moves into:
- PostgreSQL
- TimescaleDB
- MySQL
- MariaDB
- +3 more
- Coming soon
Another Databasezy instance
Moves into:
- PostgreSQL
- MySQL
- MariaDB
- Valkey
- +14 more
Continuous sync for PostgreSQL and MySQL: coming soon
Questions
Does the migration change my source database?
A copy only reads. Continuous sync is different: it needs replication enabled on the source and adds a publication or replication user there. The guide lists exactly what is added and how to remove it.
What happens to the credentials I give you?
Source credentials are kept only as a Secret in the cell that runs the copy. The Secret is deleted when the migration finishes, or after 24 hours at the latest. Our control plane does not store them.
How much downtime should I plan for?
With continuous sync, seconds: the time to change your app's connection string. Without it, the time for one copy and verify. The preflight gives you an estimate before anything runs.
Which plans include continuous sync?
Continuous sync for Postgres and MySQL is part of the Solo plan and above, and arrives in rollout phase 2.
What if verification finds a difference?
The result lists each table or collection that does not match. Nothing is switched for you: you decide whether to re-run the copy, fix the source, or carry on.
Can I move a database onto secure hosting this way?
Yes, once instance-to-instance copies ship (coming soon). They cover engine upgrades, region moves and moving a database from shared to secure hosting, which needs a signed BAA for your organization.
Bring your database over
Start with a preflight. Before any data is copied, it tells you what will move, how big the target should be and how long the copy takes.