What to Watch When DB Types Differ
When the DB that produced the source dump and the target DB you apply it to are different products (for example, applying a PostgreSQL dump to a MySQL DB), the SQL syntax is incompatible and the apply can fail. This guide explains how KIOPS handles engine compatibility, and what is and is not possible in the current UI.
Before You Start: Terms to Know
- Source DB: The DB that produced the original dump. The file itself contains the source DB's syntax verbatim.
- Target DB: The destination DB where the dump will be applied.
- Engine compatibility group: A set of DBs whose SQL syntax is mutually compatible. KIOPS treats MySQL and MariaDB as one group, and PostgreSQL as a separate group.
- Cross-engine: Two DBs in different compatibility groups (for example, MySQL ↔ PostgreSQL).
- Schema conversion: Translating the column types, defaults, and options in DDL statements such as
CREATE TABLEinto another engine's syntax.
Key Point: What Is Possible in KIOPS Today
KIOPS's backend has logic to convert MySQL/MariaDB ↔ PostgreSQL dumps, but the current UI has no entry point for enabling a conversion option. Neither the data package apply screen (PackageApplyModal) nor the package-apply path in the Migration tab offers a conversion option.
The combinations you can apply a SQL dump with in KIOPS today are as follows.
| Source dump engine | Target DB engine | Can apply |
|---|---|---|
| MySQL / MariaDB | MySQL / MariaDB | Yes (same compatibility group) |
| PostgreSQL | PostgreSQL | Yes (same engine) |
| MySQL / MariaDB | PostgreSQL | Not applicable |
| PostgreSQL | MySQL / MariaDB | Not applicable |
MySQL and MariaDB are in the same compatibility group, so they can be applied to each other without conversion.
For cross-engine combinations, KIOPS's behavior depends on the apply path. The package-apply in the Migration tab checks engine consistency and disables the apply button, preventing it up front. The data package apply screen (PackageApplyModal) has no pre-check guard, so attempting a cross-engine apply there will fail due to SQL syntax mismatch. Either way, a cross-engine DB cannot be applied without conversion.
Prerequisites
- DB connection registered: The target DB to apply to must be registered on the DB Connections tab.
- Engine match check: Confirm in advance that the engine of the dump you have and the engine of the target DB are in the same compatibility group.
The Migration Tab Blocks Cross-Engine Applies
In the Migration tab, when you set "Source type" to "Stored data package (one-time apply)", KIOPS automatically checks the engine consistency between the selected package's DB type and the target DB.
- Same compatibility group (MySQL↔MariaDB included): An "engine consistency OK" notice appears and the apply button is enabled.
- Cross-engine: A "Cross-engine - migration not possible" warning appears and the apply button is disabled. Different engines have incompatible SQL syntax, so the apply would fail.
So an attempt to apply a PostgreSQL dump to a MySQL DB, or vice versa, without conversion is blocked by KIOPS up front.
If You Must Move Data Between Different DB Types
If you need to move data between environments of different DB products, you cannot do it with automatic conversion inside the current KIOPS UI. Consider these approaches.
- Prepare a dump matching the target engine externally: Ask the source DB owner for a dump produced in the target engine's syntax, or use an external conversion tool to produce a converted
.sqlfile in advance and upload it to KIOPS. - Use Sync Jobs for recurring data replication: If you need to keep data in sync between two DBs periodically, check the scope of the [Database Management] > Sync Jobs tab.
- Ask your operations team about exposing the conversion feature: The backend conversion logic itself exists, so if you need to use cross-engine conversion from the UI, ask the KIOPS operations team whether the feature can be enabled.
Reference: Scope of the Backend Conversion Logic
The following describes the scope of the conversion logic implemented in KIOPS's backend. It is not called directly from the current UI, so it only matters in environments where the operations team has separately enabled the conversion feature. General users may skip this section.
MySQL/MariaDB → PostgreSQL (schema only)
This direction converts the schema only - data rows (INSERT) are not converted. The main mappings are:
| Source (MySQL/MariaDB) | Converted result (PostgreSQL) |
|---|---|
Backtick identifier `col` | backticks removed |
int + AUTO_INCREMENT | SERIAL |
bigint + AUTO_INCREMENT | BIGSERIAL |
smallint + AUTO_INCREMENT | SMALLSERIAL |
tinyint(1) | BOOLEAN |
other tinyint(n) | SMALLINT |
int(N) / bigint(N) / smallint(N) | display width removed, then INTEGER / BIGINT / SMALLINT |
datetime | TIMESTAMP |
blob / longblob / mediumblob / tinyblob | BYTEA |
longtext / mediumtext / tinytext | TEXT |
longtext + CHECK(json_valid(...)) | JSONB |
ENGINE=..., DEFAULT CHARSET=..., COLLATE=... table options | removed |
current_timestamp() | CURRENT_TIMESTAMP |
KEY / UNIQUE KEY definitions | split into separate CREATE INDEX statements |
INSERT data rows are not converted, so for this direction you must load data separately on top of the converted schema.
PostgreSQL → MySQL/MariaDB (schema + optional data)
This direction converts the schema and, when the option is on, can also convert the COPY data block. The main mappings are:
| Source (PostgreSQL) | Converted result (MySQL/MariaDB) |
|---|---|
public. schema prefix | removed |
SERIAL | INT AUTO_INCREMENT |
BIGSERIAL | BIGINT AUTO_INCREMENT |
SMALLSERIAL | SMALLINT AUTO_INCREMENT |
BOOLEAN | TINYINT(1) |
TIMESTAMP (with/without time zone) | DATETIME |
BYTEA | LONGBLOB |
JSONB | JSON |
CHARACTER VARYING(n) | VARCHAR(n) |
casts such as 'foo'::text | cast removed |
DEFAULT nextval(...) | removed |
| table options | ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci added |
COPY data block | converted to INSERT statements when the option is on |
User-defined functions, triggers, sequences, extensions, VIEWs, and so on are not converted.
Always Verify After Applying a Converted Result
Engine conversion is automated but not 100% perfect. If you applied a converted dump, verify the following right after the apply.
- Table count and column count: Compare against the source DB to confirm no tables are missing.
- Column types: Confirm key business columns (amounts, dates, JSON, etc.) were created with the intended types.
- Indexes and constraints: Confirm PK / UK / FK / NOT NULL carried over.
- Defaults: Confirm
CURRENT_TIMESTAMPand sequence-based defaults landed correctly. - Sample queries: Check that frequently used SELECT/INSERT statements run normally.
- Data rows: For the MySQL→PG direction, empty data is normal. For the PG→MySQL direction, if you moved data too, compare row counts.
Rehearse the converted result on staging first, run the checklist above once, and only then apply to production. In particular, user-defined functions, triggers, sequences, and extensions are not subject to automatic conversion.
What to Do Next
- Simple flow for moving a dump between the same engine → Upload a SQL Dump File
- Applying a stored dump to multiple environments → Using the Data Package Storage
- Recurring data replication → [Database Management] > Sync Jobs tab
Related Guides
- Page reference: [Database Management] page guide (
pages/database) - Operational backup flow: Backup/Recovery scenarios