sqlite3-to-mysql


Namesqlite3-to-mysql JSON
Version 2.3.2 PyPI version JSON
download
home_pageNone
SummaryA simple Python tool to transfer data from SQLite 3 to MySQL
upload_time2024-10-26 14:09:41
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords data migrate migration mysql sqlite3 transfer
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI](https://img.shields.io/pypi/v/sqlite3-to-mysql)](https://pypi.org/project/sqlite3-to-mysql/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/sqlite3-to-mysql)](https://pypistats.org/packages/sqlite3-to-mysql)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/sqlite3-to-mysql)](https://pypi.org/project/sqlite3-to-mysql/)
[![MySQL Support](https://img.shields.io/static/v1?label=MySQL&message=5.5+|+5.6+|+5.7+|+8.0+|+8.4&color=2b5d80)](https://img.shields.io/static/v1?label=MySQL&message=5.5+|+5.6+|+5.7+|+8.0+|+8.4&color=2b5d80)
[![MariaDB Support](https://img.shields.io/static/v1?label=MariaDB&message=5.5+|+10.0+|+10.1+|+10.2+|+10.3+|+10.4+|+10.5+|+10.6|+10.11+|+11.4&color=C0765A)](https://img.shields.io/static/v1?label=MariaDB&message=5.5|+10.0+|+10.1+|+10.2+|+10.3+|+10.4+|+10.5|+11.4&color=C0765A)
[![GitHub license](https://img.shields.io/github/license/techouse/sqlite3-to-mysql)](https://github.com/techouse/sqlite3-to-mysql/blob/master/LICENSE)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE-OF-CONDUCT.md)
[![PyPI - Format](https://img.shields.io/pypi/format/sqlite3-to-mysql)]((https://pypi.org/project/sqlite3-to-mysql/))
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d33b59d35b924711aae9418741a923ae)](https://www.codacy.com/manual/techouse/sqlite3-to-mysql?utm_source=github.com&utm_medium=referral&utm_content=techouse/sqlite3-to-mysql&utm_campaign=Badge_Grade)
[![Test Status](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/test.yml/badge.svg)](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/test.yml)
[![CodeQL Status](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/codeql-analysis.yml)
[![Publish PyPI Package Status](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/publish.yml/badge.svg)](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/publish.yml)
[![Publish Docker Image](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/docker.yml/badge.svg)](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/docker.yml)
[![codecov](https://codecov.io/gh/techouse/sqlite3-to-mysql/branch/master/graph/badge.svg)](https://codecov.io/gh/techouse/sqlite3-to-mysql)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/techouse)](https://github.com/sponsors/techouse)
[![GitHub stars](https://img.shields.io/github/stars/techouse/sqlite3-to-mysql.svg?style=social&label=Star&maxAge=2592000)](https://github.com/techouse/sqlite3-to-mysql/stargazers)

# SQLite3 to MySQL

#### A simple Python tool to transfer data from SQLite 3 to MySQL.

### How to run

```bash
pip install sqlite3-to-mysql
sqlite3mysql --help
```

### Usage

```
Usage: sqlite3mysql [OPTIONS]

Options:
  -f, --sqlite-file PATH          SQLite3 database file  [required]
  -t, --sqlite-tables TUPLE       Transfer only these specific tables (space
                                  separated table names). Implies --without-
                                  foreign-keys which inhibits the transfer of
                                  foreign keys.
  -X, --without-foreign-keys      Do not transfer foreign keys.
  -W, --ignore-duplicate-keys     Ignore duplicate keys. The default behavior
                                  is to create new ones with a numerical
                                  suffix, e.g. 'exising_key' ->
                                  'existing_key_1'
  -d, --mysql-database TEXT       MySQL database name  [required]
  -u, --mysql-user TEXT           MySQL user  [required]
  -p, --prompt-mysql-password     Prompt for MySQL password
  --mysql-password TEXT           MySQL password
  -h, --mysql-host TEXT           MySQL host. Defaults to localhost.
  -P, --mysql-port INTEGER        MySQL port. Defaults to 3306.
  -S, --skip-ssl                  Disable MySQL connection encryption.
  -i, --mysql-insert-method [DEFAULT|IGNORE|UPDATE]
                                  MySQL insert method. DEFAULT will throw
                                  errors when encountering duplicate records;
                                  UPDATE will update existing rows; IGNORE
                                  will ignore insert errors. Defaults to
                                  IGNORE.
  -E, --mysql-truncate-tables     Truncates existing tables before inserting
                                  data.
  --mysql-integer-type TEXT       MySQL default integer field type. Defaults
                                  to INT(11).
  --mysql-string-type TEXT        MySQL default string field type. Defaults to
                                  VARCHAR(255).
  --mysql-text-type [LONGTEXT|MEDIUMTEXT|TEXT|TINYTEXT]
                                  MySQL default text field type. Defaults to
                                  TEXT.
  --mysql-charset TEXT            MySQL database and table character set
                                  [default: utf8mb4]
  --mysql-collation TEXT          MySQL database and table collation
  -T, --use-fulltext              Use FULLTEXT indexes on TEXT columns. Will
                                  throw an error if your MySQL version does
                                  not support InnoDB FULLTEXT indexes!
  --with-rowid                    Transfer rowid columns.
  -c, --chunk INTEGER             Chunk reading/writing SQL records
  -K, --mysql-skip-create-tables  Skip creating tables in MySQL.
  -J, --mysql-skip-transfer-data  Skip transferring data to MySQL.
  -l, --log-file PATH             Log file
  -q, --quiet                     Quiet. Display only errors.
  --debug                         Debug mode. Will throw exceptions.
  --version                       Show the version and exit.
  --help                          Show this message and exit.
```

#### Docker

If you don't want to install the tool on your system, you can use the Docker image instead.

```bash
docker run -it \
    --workdir $(pwd) \
    --volume $(pwd):$(pwd) \
    --rm ghcr.io/techouse/sqlite3-to-mysql:latest \
    --sqlite-file baz.db \
    --mysql-user foo \
    --mysql-password bar \
    --mysql-database baz \
    --mysql-host host.docker.internal
```

This will mount your host current working directory (pwd) inside the Docker container as the current working directory.
Any files Docker would write to the current working directory are written to the host directory where you did docker
run. Note that you have to also use a
[special hostname](https://docs.docker.com/desktop/networking/#use-cases-and-workarounds-for-all-platforms)
`host.docker.internal`
to access your host machine from inside the Docker container.

#### Homebrew

If you're on macOS, you can install the tool using [Homebrew](https://brew.sh/).

```bash
brew tap techouse/sqlite3-to-mysql
brew install sqlite3-to-mysql
sqlite3mysql --help
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sqlite3-to-mysql",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "data, migrate, migration, mysql, sqlite3, transfer",
    "author": null,
    "author_email": "Klemen Tusar <techouse@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ff/f9/7e3c2deb9ab94a9a247b3659d1d3d1fb46629e4da57910600ed172e1d8a8/sqlite3_to_mysql-2.3.2.tar.gz",
    "platform": null,
    "description": "[![PyPI](https://img.shields.io/pypi/v/sqlite3-to-mysql)](https://pypi.org/project/sqlite3-to-mysql/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/sqlite3-to-mysql)](https://pypistats.org/packages/sqlite3-to-mysql)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/sqlite3-to-mysql)](https://pypi.org/project/sqlite3-to-mysql/)\n[![MySQL Support](https://img.shields.io/static/v1?label=MySQL&message=5.5+|+5.6+|+5.7+|+8.0+|+8.4&color=2b5d80)](https://img.shields.io/static/v1?label=MySQL&message=5.5+|+5.6+|+5.7+|+8.0+|+8.4&color=2b5d80)\n[![MariaDB Support](https://img.shields.io/static/v1?label=MariaDB&message=5.5+|+10.0+|+10.1+|+10.2+|+10.3+|+10.4+|+10.5+|+10.6|+10.11+|+11.4&color=C0765A)](https://img.shields.io/static/v1?label=MariaDB&message=5.5|+10.0+|+10.1+|+10.2+|+10.3+|+10.4+|+10.5|+11.4&color=C0765A)\n[![GitHub license](https://img.shields.io/github/license/techouse/sqlite3-to-mysql)](https://github.com/techouse/sqlite3-to-mysql/blob/master/LICENSE)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE-OF-CONDUCT.md)\n[![PyPI - Format](https://img.shields.io/pypi/format/sqlite3-to-mysql)]((https://pypi.org/project/sqlite3-to-mysql/))\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d33b59d35b924711aae9418741a923ae)](https://www.codacy.com/manual/techouse/sqlite3-to-mysql?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=techouse/sqlite3-to-mysql&amp;utm_campaign=Badge_Grade)\n[![Test Status](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/test.yml/badge.svg)](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/test.yml)\n[![CodeQL Status](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/codeql-analysis.yml)\n[![Publish PyPI Package Status](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/publish.yml/badge.svg)](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/publish.yml)\n[![Publish Docker Image](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/docker.yml/badge.svg)](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/docker.yml)\n[![codecov](https://codecov.io/gh/techouse/sqlite3-to-mysql/branch/master/graph/badge.svg)](https://codecov.io/gh/techouse/sqlite3-to-mysql)\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/techouse)](https://github.com/sponsors/techouse)\n[![GitHub stars](https://img.shields.io/github/stars/techouse/sqlite3-to-mysql.svg?style=social&label=Star&maxAge=2592000)](https://github.com/techouse/sqlite3-to-mysql/stargazers)\n\n# SQLite3 to MySQL\n\n#### A simple Python tool to transfer data from SQLite 3 to MySQL.\n\n### How to run\n\n```bash\npip install sqlite3-to-mysql\nsqlite3mysql --help\n```\n\n### Usage\n\n```\nUsage: sqlite3mysql [OPTIONS]\n\nOptions:\n  -f, --sqlite-file PATH          SQLite3 database file  [required]\n  -t, --sqlite-tables TUPLE       Transfer only these specific tables (space\n                                  separated table names). Implies --without-\n                                  foreign-keys which inhibits the transfer of\n                                  foreign keys.\n  -X, --without-foreign-keys      Do not transfer foreign keys.\n  -W, --ignore-duplicate-keys     Ignore duplicate keys. The default behavior\n                                  is to create new ones with a numerical\n                                  suffix, e.g. 'exising_key' ->\n                                  'existing_key_1'\n  -d, --mysql-database TEXT       MySQL database name  [required]\n  -u, --mysql-user TEXT           MySQL user  [required]\n  -p, --prompt-mysql-password     Prompt for MySQL password\n  --mysql-password TEXT           MySQL password\n  -h, --mysql-host TEXT           MySQL host. Defaults to localhost.\n  -P, --mysql-port INTEGER        MySQL port. Defaults to 3306.\n  -S, --skip-ssl                  Disable MySQL connection encryption.\n  -i, --mysql-insert-method [DEFAULT|IGNORE|UPDATE]\n                                  MySQL insert method. DEFAULT will throw\n                                  errors when encountering duplicate records;\n                                  UPDATE will update existing rows; IGNORE\n                                  will ignore insert errors. Defaults to\n                                  IGNORE.\n  -E, --mysql-truncate-tables     Truncates existing tables before inserting\n                                  data.\n  --mysql-integer-type TEXT       MySQL default integer field type. Defaults\n                                  to INT(11).\n  --mysql-string-type TEXT        MySQL default string field type. Defaults to\n                                  VARCHAR(255).\n  --mysql-text-type [LONGTEXT|MEDIUMTEXT|TEXT|TINYTEXT]\n                                  MySQL default text field type. Defaults to\n                                  TEXT.\n  --mysql-charset TEXT            MySQL database and table character set\n                                  [default: utf8mb4]\n  --mysql-collation TEXT          MySQL database and table collation\n  -T, --use-fulltext              Use FULLTEXT indexes on TEXT columns. Will\n                                  throw an error if your MySQL version does\n                                  not support InnoDB FULLTEXT indexes!\n  --with-rowid                    Transfer rowid columns.\n  -c, --chunk INTEGER             Chunk reading/writing SQL records\n  -K, --mysql-skip-create-tables  Skip creating tables in MySQL.\n  -J, --mysql-skip-transfer-data  Skip transferring data to MySQL.\n  -l, --log-file PATH             Log file\n  -q, --quiet                     Quiet. Display only errors.\n  --debug                         Debug mode. Will throw exceptions.\n  --version                       Show the version and exit.\n  --help                          Show this message and exit.\n```\n\n#### Docker\n\nIf you don't want to install the tool on your system, you can use the Docker image instead.\n\n```bash\ndocker run -it \\\n    --workdir $(pwd) \\\n    --volume $(pwd):$(pwd) \\\n    --rm ghcr.io/techouse/sqlite3-to-mysql:latest \\\n    --sqlite-file baz.db \\\n    --mysql-user foo \\\n    --mysql-password bar \\\n    --mysql-database baz \\\n    --mysql-host host.docker.internal\n```\n\nThis will mount your host current working directory (pwd) inside the Docker container as the current working directory.\nAny files Docker would write to the current working directory are written to the host directory where you did docker\nrun. Note that you have to also use a\n[special hostname](https://docs.docker.com/desktop/networking/#use-cases-and-workarounds-for-all-platforms)\n`host.docker.internal`\nto access your host machine from inside the Docker container.\n\n#### Homebrew\n\nIf you're on macOS, you can install the tool using [Homebrew](https://brew.sh/).\n\n```bash\nbrew tap techouse/sqlite3-to-mysql\nbrew install sqlite3-to-mysql\nsqlite3mysql --help\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A simple Python tool to transfer data from SQLite 3 to MySQL",
    "version": "2.3.2",
    "project_urls": {
        "Changelog": "https://github.com/techouse/sqlite3-to-mysql/blob/master/CHANGELOG.md",
        "Documentation": "https://techouse.github.io/sqlite3-to-mysql/",
        "Homepage": "https://techouse.github.io/sqlite3-to-mysql/",
        "PayPal": "https://paypal.me/ktusar",
        "Source": "https://github.com/techouse/sqlite3-to-mysql",
        "Sponsor": "https://github.com/sponsors/techouse"
    },
    "split_keywords": [
        "data",
        " migrate",
        " migration",
        " mysql",
        " sqlite3",
        " transfer"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6efb69604fb3312a355f369c29564b8d68015ddb1d78eecbe3004a6424cbb247",
                "md5": "e639c977089031d833d813a3b39156c9",
                "sha256": "dfa8a6d617583730ce1e8f63e6ca1d4395c5351653a1436ed40b4628ca0be2e2"
            },
            "downloads": -1,
            "filename": "sqlite3_to_mysql-2.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e639c977089031d833d813a3b39156c9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 20312,
            "upload_time": "2024-10-26T14:09:39",
            "upload_time_iso_8601": "2024-10-26T14:09:39.991098Z",
            "url": "https://files.pythonhosted.org/packages/6e/fb/69604fb3312a355f369c29564b8d68015ddb1d78eecbe3004a6424cbb247/sqlite3_to_mysql-2.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fff97e3c2deb9ab94a9a247b3659d1d3d1fb46629e4da57910600ed172e1d8a8",
                "md5": "4642af8464163707762521c379a7f9db",
                "sha256": "e0b92230f2ff14697f36a6084b0a0cf108b43db761bde3e5773e2bc93144c4da"
            },
            "downloads": -1,
            "filename": "sqlite3_to_mysql-2.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "4642af8464163707762521c379a7f9db",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 36805,
            "upload_time": "2024-10-26T14:09:41",
            "upload_time_iso_8601": "2024-10-26T14:09:41.458717Z",
            "url": "https://files.pythonhosted.org/packages/ff/f9/7e3c2deb9ab94a9a247b3659d1d3d1fb46629e4da57910600ed172e1d8a8/sqlite3_to_mysql-2.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-26 14:09:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "techouse",
    "github_project": "sqlite3-to-mysql",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "sqlite3-to-mysql"
}
        
Elapsed time: 0.52719s