From b6409bc53885116c3136407b2c9fbec257641c10 Mon Sep 17 00:00:00 2001 From: "Carrie Warner (Mattermost)" <74422101+cwarnermm@users.noreply.github.com> Date: Thu, 16 May 2024 14:09:12 -0400 Subject: [PATCH] Clarified format of postgres_dsn (#7139) * Clarified format of postgres_dsn * Update source/deploy/postgres-migration.rst Co-authored-by: Ibrahim Serdar Acikgoz * Update source/deploy/postgres-migration.rst Co-authored-by: Ibrahim Serdar Acikgoz * Update source/deploy/postgres-migration.rst Co-authored-by: Ibrahim Serdar Acikgoz --------- Co-authored-by: Ibrahim Serdar Acikgoz --- source/deploy/postgres-migration.rst | 8 ++++++-- source/images/creation-outline_F1C2B copy.svg | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 source/images/creation-outline_F1C2B copy.svg diff --git a/source/deploy/postgres-migration.rst b/source/deploy/postgres-migration.rst index 52fc1404822..a481d512b1c 100644 --- a/source/deploy/postgres-migration.rst +++ b/source/deploy/postgres-migration.rst @@ -275,9 +275,13 @@ For our case, we can simply run the following command: .. code:: sh - dbcmp --source "${MYSQL_DSN}" --target "${POSTGRES_DSN}" --exclude="db_migrations,ir_,focalboard,systems" + dbcmp --source "${MYSQL_DSN}" --target "${POSTGRES_DSN} " --exclude="db_migrations,ir_,focalboard,systems" -Note that this migration guide only covers the tables for Mattermost products. +An example command would look like: ``dbcmp --source "user:password@tcp(address:3306)/db_name --target "postgres://user:password@address:5432/db_name`` + +.. note:: + + ``POSTGRES_DSN`` should start with a ``postgres://`` prefix. This way ``dbcmp`` decides which driver to use while connecting to a database. Another exclusion we are making is in the ``db_migrations`` table which has a small difference (a typo in a single migration name) and creates a diff. Since we created the PostgreSQL schema with morph, and the official ``mattermost`` source, we can skip it safely without concerns. On the other hand, ``systems`` table may contain additional diffs if there were extra keys added during some of the migrations. Consider excluding the ``systems`` table if you run into issues, and perform a manual comparison as the data in the ``systems`` table is relatively smaller in size. diff --git a/source/images/creation-outline_F1C2B copy.svg b/source/images/creation-outline_F1C2B copy.svg new file mode 100644 index 00000000000..6cf8773ef79 --- /dev/null +++ b/source/images/creation-outline_F1C2B copy.svg @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file