diff --git a/docs/configuration.rst b/docs/configuration.rst index bbfa6fe5..2f7e27a7 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -316,12 +316,12 @@ Alternatives hosted options like PostgreSQL and MariaDB/MySQL can be configured but the development team recommends against it. Indeed, there is currently very little data to be stored and SQLite is deemed both sufficient, simpler and more reliable overall. -- ``SQLALCHEMY_DATABASE_URI`` (default: sqlite:////data/main.db): the SQLAlchemy database URL for accessing the database -- ``SQLALCHEMY_DATABASE_URI_ROUNDCUBE`` (default: sqlite:////data/roundcube.db): the Roundcube database URL for accessing the Roundcube database +- ``SQLALCHEMY_DATABASE_URI`` (default: ``sqlite:////data/main.db``): the SQLAlchemy database URL for accessing the database +- ``SQLALCHEMY_DATABASE_URI_ROUNDCUBE`` (default: ``sqlite:////data/roundcube.db``): the Roundcube database URL for accessing the Roundcube database For PostgreSQL use driver postgresql (``SQLALCHEMY_DATABASE_URI=postgresql://mailu:mailu_secret_password@database/mailu``). -For MariaDB/MySQL use driver mysql+mysqlconnector (``SQLALCHEMY_DATABASE_URI= mysql+mysqlconnector://mailu:mailu_secret_password@database/mailu```). +For MariaDB/MySQL use driver mysql+mysqlconnector (``SQLALCHEMY_DATABASE_URI= mysql+mysqlconnector://mailu:mailu_secret_password@database/mailu``). For Roundcube, refer to the `roundcube documentation`_ for the URL specification. diff --git a/docs/database.rst b/docs/database.rst index 7163acaf..26da8dd5 100644 --- a/docs/database.rst +++ b/docs/database.rst @@ -17,11 +17,20 @@ This means it is not possible to switch the database back-end used by roundcube To switch to a different database back-end: -1. Run config-export to export the configuration. E.g. `docker compose exec admin flask mailu config-export --secrets --output mail-config.yml` +1. Run config-export to export the configuration. E.g. `docker compose exec admin flask mailu config-export --secrets --output /data/mail-config.yml` 2. Set up your new database server. Refer to the subsequent sections for tips for creating the database. 3. Modify the database settings (SQLAlchemy database URL) in mailu.env. Refer to the :ref:`configuration guide (link) ` for the exact settings. 4. Start your Mailu deployment. -5. Run config-import to import the configuration. E.g. `docker exec -i $(docker compose ps -q admin) flask mailu config-import -v < mail-config.yml` +5. Run config-import to import the configuration... + + 1. Drop into a shell inside the admin container as you'll need to execute multiple commands. E.g. `docker exec -i $(docker compose ps -q admin) bash` + + 2. Initialize the new database backend: `flask mailu db init` + + 3. Migrate the new database backend to the current state: `flask mailu db upgrade` + + 4. Import the configuration export: `flask mailu config-import -v < /data/mail-config.yml` + Mailu has now been switched to the new database back-end. The Mailu configuration has also been migrated.