Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Turso 2 min read How-to mediumAdept

Migrating data from MySQL to Turso

Moving a MySQL database to Turso takes three commands: dump it with mysqldump using --skip-extended-insert, convert the dump to a SQLite file with the mysql2sqlite script piped into sqlite3, then create a Turso database from that file with `turso db create --from-file`. Row counts can be checked with the sqlite3 shell after conversion and with `turso db shell` after import. Larger migrations may hit issues that need extra help.

Related posts

  • Migrating from PostgreSQL/MySQL to SQLite: When and How to Make the Switch

    Turso mediumAdept

    SQLite, especially via Turso Cloud, can replace PostgreSQL or MySQL for read-heavy, moderate-write workloads, trading complex-JOIN optimization, stored procedures, rich types and native replication for simpler operations, lower cost and local reads. Migration steps: dump schema and data as INSERT statements with pg_dump or mysqldump, translate types (SERIAL to INTEGER PRIMARY KEY, BOOLEAN to INTEGER, arrays to JSON text), convert to WAL mode and checkpoint, then import with `turso db import` or the Platform API upload flow (up to 20GB). Before cutover, compare query plans, load test at p50/p95/p99, and verify that write patterns tolerate SQLite's single-writer model or use Turso's MVCC-based BEGIN CONCURRENT.

  • You can now migrate your existing databases to AWS

    Turso mediumAdept

    Turso paid-plan users can move database groups from Fly.io to AWS with new `turso group aws-migration info/start/abort` CLI commands; free-tier users have already been migrated. Migration is irreversible, keeps databases read-only with writes paused (usually under a minute, longer for 1 GB+), and drops features such as cross-database ATTACH, multi-DB schemas, server-side WebSockets, edge replicas and some extensions like sqlite-vss. Embedded replicas need their local files deleted and re-synced because the on-disk format and protocol differ. For remote writes, use execute/run paths without RETURNING, keep transactions short, avoid cached write statements, and reconnect and retry on stream errors, with SDK-specific guidance for JS, Python and Go or a switch to the new Turso Sync push-based packages.

  • Turso v0.6.0

    Turso mediumAdept

    Turso 0.6 is the first release supporting all major SQLite features, adding experimental multi-process WAL access (OFD locks on Linux, fcntl elsewhere, IOCP on Windows) and VACUUM/VACUUM INTO. SQL additions include production-ready triggers, temp tables, virtual generated columns, CREATE TABLE AS SELECT, partial WITHOUT ROWID support, UPDATE...FROM, FILTER on aggregates, NULLS FIRST/LAST, and INDEXED BY hints. The STRICT type system gains arrays, structs/unions and Postgres-style domains, and MVCC logical logs are now encrypted with AEAD in 32 KiB chunks. SDK changes add query timeouts, async prepare, fixed interactive transactions in the serverless driver, an npm-distributed CLI and a SQLAlchemy asyncio dialect.

  • Create a fast, performant admin UI with Retool and Turso

    Turso mediumAdept

    A Retool admin dashboard for an e-commerce mug store can read and write data in a Turso (libSQL) database through Turso's HTTP API, configured as a Retool REST API resource. The resource uses the database URL with https in place of libsql, plus a Bearer token header. Queries POST SQL statements, and a transform function maps the column/row response into objects for a Retool table. A form with a category select submits inserts, and a success handler refreshes the product list.

  • Turso Sync: a much, much, much better way to sync

    Turso mediumAdept

    Turso, a Rust rewrite of SQLite, replaces libSQL's Embedded Replicas with a sync model built on change data capture, shipping logical changes instead of physical pages and splitting sync into separate push() and pull() operations. Page-based replication wasted bandwidth, could not resolve conflicts (so writes defaulted to the remote), and diverged around checkpoints, forcing re-bootstraps. In Node.js benchmarks against Turso Cloud, Turso sync was 8.9x faster with 16.3x less traffic for 3,000 sequential inserts, 312x faster for read-your-writes cycles with local writes (7.3x even when pushing after every write), and 2.1x faster for an initial pull. Turso also supports partial, lazy bootstrap, and the recommendation is to switch from libSQL sync to Turso.

The quest for software engineering knowledge.

Look:
Layout: