LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

musql-convert

Convert between SQLite files and musql segment databases

TLDR

Import a SQLite database into musql's format
$ musql-convert import [app.db] [app.musq]
copy
Import even when integrity_check fails
$ musql-convert import -force [app.db] [app.musq]
copy
Export a .musq database back to SQLite
$ musql-convert export [app.musq] [exported.db]
copy
Choose the SQLite page size on export
$ musql-convert export -page-size 4096 [app.musq] [exported.db]
copy

SYNOPSIS

musql-convert import [-force] in.db out.musqmusql-convert export [-page-size n] in.musq out.db

DESCRIPTION

musql-convert copies a database between the SQLite file format and musql's `.musq` segment format. It is the only program in the musql repository that reads or writes a SQLite file. The SQL engine and musqld open `.musq` files only.import reads a SQLite database and writes a musql database. export reads a musql database and writes a SQLite file that other SQLite tools can open.Both directions take exactly two paths. A missing subcommand, the wrong number of paths, or an unknown subcommand prints the usage to stderr and exits 2. A conversion error is printed as `musql-convert:` plus the message and exits 1.From a checkout of the module that contains the converter:

$ go install github.com/samyfodil/musql/cmd/musql-convert@latest
copy
GitHub release archives also include the musql-convert binary next to musqld.

PARAMETERS

import in.db out.musq

Read a SQLite database and write a musql database.
-force
Import a source that fails `integrity_check`. Without this flag that source is refused.
export in.musq out.db
Read a musql database and write a SQLite file.
-page-size n
Page size of the SQLite file written by export. 0 (the default) keeps the database's own page size.

CAVEATS

The engine never opens a SQLite file in place. After import, applications and musqld must use the `.musq` path. A Go program using the musql driver opens it with `sql.Open("sqlite", "app.musq")` or the `musql` driver name. That driver name is the in-process registration, not this command.SQL compatibility and file compatibility are separate. A database that converts can still use storage behavior that is not SQLite's, including page-count pragmas. `PRAGMA maxpagecount` is declined; musql uses `PRAGMA max_size` in bytes.-force writes a database whose source already failed SQLite's integrity check. Check the result before serving it.The Go flag parser accepts one or two dashes (`-force` and `--force`). The usage line prints the single-dash form.

HISTORY

musql-convert ships with musql ("muscle"), an Apache-2.0 project by samyfodil. Release v0.2.1 was published on 7 October 2026. Building from source needs Go 1.27 or newer, matching the rest of the repository.

SEE ALSO

musqld(1), sqlite3(1), go(1)

RESOURCES

Copied to clipboard
Kai