From def6dba82549fef0db7df473382bb8ec568a6f3d Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Sun, 4 Jul 2021 21:02:57 +0200 Subject: [PATCH] Replace MySQL by MariaDB in all documentation / README / changelog Also document the new requirement for MariaDB >= 10.3.2 Fixes: #632 Fixes: #743 --- CHANGELOG.rst | 2 ++ README.rst | 2 +- docs/configuration.rst | 6 +++++- docs/installation.rst | 8 ++++---- docs/upgrade.rst | 26 +++++++++++++++++++++++++- 5 files changed, 37 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 67f5fab4..5d07998a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,8 @@ Breaking changes - Drop support for Python 2 (#483) - Drop support for Python 3.5 (#571) +- Drop support for MySQL (#743) +- Require MariaDB version 10.3.2 or above (#632) The minimum supported version is now Python 3.6 diff --git a/README.rst b/README.rst index de3fb48d..e3e20e4e 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,7 @@ Requirements ============ * **Python**: version 3.6 to 3.9. -* **Backends**: MySQL, PostgreSQL, SQLite, Memory. +* **Backends**: SQLite, PostgreSQL, MariaDB (version 10.3.2 or above), Memory. Contributing ============ diff --git a/docs/configuration.rst b/docs/configuration.rst index 7e29da1c..a1e34bed 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -24,7 +24,11 @@ format used can be found on `the SQLAlchemy documentation`_. ``sqlite:///home/ihatemoney/ihatemoney.db``. Do *not* store it under ``/tmp`` as this folder is cleared at each boot. -If you're using PostgreSQL, Your client must use utf8. Unfortunately, +For example, if you're using MariaDB, use a configuration similar to the following:: + + SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://user:pass@localhost/dbname' + +If you're using PostgreSQL, your client must use utf8. Unfortunately, PostgreSQL default is to use ASCII. Either change your client settings, or specify the encoding by appending ``?client_encoding=utf8`` to the connection string. This will look like:: diff --git a/docs/installation.rst b/docs/installation.rst index a366cbe3..74ca8335 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -20,7 +20,7 @@ Requirements «Ihatemoney» depends on: * **Python**: version 3.6 to 3.9 included will work. -* **A Backend**: to choose among MySQL, PostgreSQL, SQLite or Memory. +* **A Backend**: to choose among SQLite, PostgreSQL, MariaDB (>= 10.3.2) or Memory. * **Virtual environment** (recommended): `python3-venv` package under Debian/Ubuntu. We recommend to use `virtual environment `_ but @@ -65,10 +65,10 @@ Once installed, you can start a test server:: And point your browser at `http://localhost:5000 `_. -Configure database with MySQL/MariaDB (optional) +Configure database with MariaDB (optional) ================================================ -.. note:: Only required if you use MySQL/MariaDB. +.. note:: Only required if you use MariaDB. Make sure to use MariaDB 10.3.2 or newer. 1. Install PyMySQL dependencies. On Debian or Ubuntu, that would be:: @@ -184,7 +184,7 @@ Install Gunicorn:: Obviously, adapt the ``ExecStart`` path for your installation folder. If you use SQLite as database: remove mentions of ``postgresql.service`` in ``ihatemoney.service``. - If you use MySQL or MariaDB as database: replace mentions of ``postgresql.service`` by ``mysql.service`` or ``mariadb.service`` in ``ihatemoney.service``. + If you use MariaDB as database: replace mentions of ``postgresql.service`` by ``mariadb.service`` in ``ihatemoney.service``. Then reload systemd, enable and start ``ihatemoney``:: diff --git a/docs/upgrade.rst b/docs/upgrade.rst index 0db0428b..ec846324 100644 --- a/docs/upgrade.rst +++ b/docs/upgrade.rst @@ -57,7 +57,7 @@ If you were running IHateMoney using Python < 3.6, you must, **before** upgradin or several of the following deployment options : - Gunicorn (Nginx) - - MySQL + - MariaDB - PostgreSQL If so, pick the ``pip`` commands to use in the relevant section(s) of @@ -65,6 +65,30 @@ If so, pick the ``pip`` commands to use in the relevant section(s) of Then follow :ref:`general-procedure` from step 1. in order to complete the update. +Switch to MariaDB >= 10.3.2 instead of MySQL +++++++++++++++++++++++++++++++++++++++++++++ + +.. note:: If you are using SQLite or PostgreSQL, you can skip this section, no + special action is required. + +If you were running IHateMoney with MySQL, you must switch to MariaDB. +MySQL is no longer a supported database option. + +In addition, the minimum supported version of MariaDB is 10.3.2. +See `this MySQL / MariaDB issue `_ +for details. + +To upgrade: + +1. Ensure you have a MariaDB server installed and configured, and that its + version is at least 10.3.2. + +2. Copy your database from MySQL to MariaDB. + +3. Ensure that IHateMoney is correctly configured to use your MariaDB database, + see :ref:`configuration`. + +Then follow :ref:`general-procedure` from step 1. in order to complete the update. 2.x → 3.x ---------