SQLite3 to MySQL

A Python CLI for transferring SQLite 3 schema and data to MySQL or MariaDB.

PyPI PyPI - Downloads Homebrew Formula Downloads PyPI - Python Version MySQL Support MariaDB Support GitHub license Contributor Covenant PyPI - Format Code style: black Codacy Badge Test Status CodeQL Status Publish PyPI Package Status codecov GitHub Sponsors GitHub stars

Installation

pip install sqlite3-to-mysql

Basic Usage

Use the password prompt for interactive use:

sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p -h 127.0.0.1 -P 3306

Tested Databases

See the GitHub Actions CI matrix for the current MySQL and MariaDB versions tested by the project.

Common Tasks

  • Use --mysql-skip-transfer-data to create schema only.

  • Use --mysql-skip-create-tables to transfer data into an existing MySQL schema.

  • Use either table filter (--sqlite-tables or --exclude-sqlite-tables) to transfer a table subset; this disables foreign key transfer.

  • Use --mysql-ssl-ca, --mysql-ssl-cert, and --mysql-ssl-key for certificate-based MySQL connections.

See Usage for full recipes, option notes, and MySQL/MariaDB caveats.

Indices and tables