Migrating to SQL Server from MariaDB: what changes in the target
If the SQL Server table does not exist, dbSlice stops and shows a CREATE TABLE translated for SQL Server, for your DBA to review and run. By default it creates nothing in your databases. These are the SQL Server details to look at:
- Unsigned integers. SQL Server has no unsigned types, and the suggested DDL does not mark them. Widen the columns that are unsigned in MariaDB before running it:
INT UNSIGNED→BIGINT,BIGINT UNSIGNED→DECIMAL(20,0). TINYINT(1)flags. They are suggested asSMALLINT. Declare themBITif they are booleans.- Zero dates. MariaDB can hold
0000-00-00, which SQL Server rejects. Use a SELECT as the source and turn them intoNULL, for exampleSELECT id, NULLIF(created_at, '0000-00-00 00:00:00') AS created_at, … FROM orders. - Text becomes
NVARCHAR. Up to 4,000 characters it keeps the length; above that and forLONGTEXTit becomesNVARCHAR(MAX).JSONarrives as text inNVARCHAR(MAX); SQL Server reads it withJSON_VALUEandOPENJSON. ENUM,SETandYEARare suggested as text. Add aCHECKconstraint if you want the list enforced;YEARis usually better asSMALLINT.AUTO_INCREMENTids andIDENTITY. SQL Server only accepts explicit values in anIDENTITYcolumn withIDENTITY_INSERT. dbSlice offers Keep identity for that. It needs ALTER permission on the table, and the screen asks you to confirm first. Without it, SQL Server generates new ids, so do not use the id as the sync key.- Upsert runs as
MERGE, and bulk loads useSqlBulkCopywith triggers and constraints checked, so the target's rules still apply.

How dbSlice controls the load
- Reads MariaDB in small batches, so the live database keeps serving its users.
- Matches rows by a key you choose. Modes: Initial load, then Upsert, Insert new, Update only or incremental by column (
updated_ator theAUTO_INCREMENTid). - Checks before writing with Record Diff and on-screen checks, and proves the result with Compare and the full list of divergent keys.
- Masks on the way for development and test copies, keeping keys and foreign keys intact.
- Export instead of load: when you only need a file, the same app exports a MariaDB table to CSV, JSON, XML or HTML.
Step by step: convert a table from MariaDB to SQL Server
- Connect to MariaDB and to SQL Server.
- Pick the source table (or a SELECT, as in the zero-date example) and the target table.
- Choose the key column, and turn on Keep identity if the ids must stay the same.
- Choose the mode: Initial load, then Upsert or Insert new.
- Run Record Diff, then the copy, or save it as a job for the CLI and the Task Scheduler.
Moving data between SQL Server and MariaDB in both directions
The same app moves data the other way: see SQL Server to MariaDB. For MySQL as the source, see MySQL to PostgreSQL; the same MariaDB details apply.
FAQ
Does it work with MySQL too?
Yes. MariaDB and MySQL use the same connector in dbSlice, and the details above apply to both.
Do I need to enable anything on MariaDB?
No, reading uses ordinary queries. Only bulk loading into MariaDB needs local_infile.
Are deletes copied by incremental runs?
No. Run Compare or a reload before the switch.
Is there a free version?
Yes, on the Microsoft Store: it connects, browses, compares and exports to CSV. Writing to a target needs a Desktop or Server license.