sqlite3-to-mysql


Namesqlite3-to-mysql JSON
Version 2.1.10 PyPI version JSON
download
home_pageNone
SummaryA simple Python tool to transfer data from SQLite 3 to MySQL
upload_time2024-05-12 18:56:05
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&color=2b5d80)](https://img.shields.io/static/v1?label=MySQL&message=5.6+|+5.7+|+8.0&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&color=C0765A)](https://img.shields.io/static/v1?label=MariaDB&message=10.0+|+10.1+|+10.2+|+10.3+|+10.4+|+10.5&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]

  Transfer SQLite to MySQL using the provided CLI 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 [UPDATE|IGNORE|DEFAULT]
                                  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 [MEDIUMTEXT|TEXT|TINYTEXT|LONGTEXT]
                                  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
  -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/5a/cf/e4cf35115ae320c7271e2953a0baf65bcdfed5a7bd7c7f1bfe637f97b112/sqlite3_to_mysql-2.1.10.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&color=2b5d80)](https://img.shields.io/static/v1?label=MySQL&message=5.6+|+5.7+|+8.0&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&color=C0765A)](https://img.shields.io/static/v1?label=MariaDB&message=10.0+|+10.1+|+10.2+|+10.3+|+10.4+|+10.5&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\n  Transfer SQLite to MySQL using the provided CLI 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 [UPDATE|IGNORE|DEFAULT]\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 [MEDIUMTEXT|TEXT|TINYTEXT|LONGTEXT]\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  -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) `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.1.10",
    "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": "5c825a80d60e9d6b8cc9198e02e620837349c552dbcc0de0a616ab8f33528b3b",
                "md5": "2c4acc1d5fa48d4ede1d3c6a4e3ba465",
                "sha256": "e87d1eaf19a83e8b2808f4ae932de5c02f266406643c09a613a906e6a78b0dd9"
            },
            "downloads": -1,
            "filename": "sqlite3_to_mysql-2.1.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2c4acc1d5fa48d4ede1d3c6a4e3ba465",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 19719,
            "upload_time": "2024-05-12T18:56:02",
            "upload_time_iso_8601": "2024-05-12T18:56:02.648791Z",
            "url": "https://files.pythonhosted.org/packages/5c/82/5a80d60e9d6b8cc9198e02e620837349c552dbcc0de0a616ab8f33528b3b/sqlite3_to_mysql-2.1.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5acfe4cf35115ae320c7271e2953a0baf65bcdfed5a7bd7c7f1bfe637f97b112",
                "md5": "ece9a4c8c3f659cf865640b16f07f417",
                "sha256": "2e6352fa8e3f4fcff71b7e29a9e085d067b81d81756ee655f90e700f1672ad25"
            },
            "downloads": -1,
            "filename": "sqlite3_to_mysql-2.1.10.tar.gz",
            "has_sig": false,
            "md5_digest": "ece9a4c8c3f659cf865640b16f07f417",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 35073,
            "upload_time": "2024-05-12T18:56:05",
            "upload_time_iso_8601": "2024-05-12T18:56:05.077876Z",
            "url": "https://files.pythonhosted.org/packages/5a/cf/e4cf35115ae320c7271e2953a0baf65bcdfed5a7bd7c7f1bfe637f97b112/sqlite3_to_mysql-2.1.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-12 18:56:05",
    "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.25870s