-
Notifications
You must be signed in to change notification settings - Fork 580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[guides] guides: Add postgres migration guidelines #6596
Conversation
Newest code from isacikgoz has been published to preview environment for Git SHA c220510 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cwarnermm can we apply the new code theme to this page also?
source/guides/postgres-migration.rst
Outdated
|
||
Note that the migration guide only covers the tables for Mattermost channels, the support for other plugins such as Boards and Playbooks will be added in the future. Another exlusion we are making is in the ``db_migrations`` table which has a small difference (a typo in a single migration name) creates a diff. Since we created the Postgres schema with morph and the official mattermost source, we can consider to skip it safely. On the other hand, ``systems`` table may contain additional diffs if there was extra keys added during some of the migrations. Consider excluding ``systems`` table if you run into issues and do a manual comparison as the data in the ``systems`` table is relatively smaller in size. | ||
|
||
Notes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend we move this to the top after the intro but before we get into the steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. This becomes our TL;DR :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great docs PR, @isacikgoz!! I've provided editorial feedback inline for you to consider.
source/guides/postgres-migration.rst
Outdated
|
||
Note that the migration guide only covers the tables for Mattermost channels, the support for other plugins such as Boards and Playbooks will be added in the future. Another exlusion we are making is in the ``db_migrations`` table which has a small difference (a typo in a single migration name) creates a diff. Since we created the Postgres schema with morph and the official mattermost source, we can consider to skip it safely. On the other hand, ``systems`` table may contain additional diffs if there was extra keys added during some of the migrations. Consider excluding ``systems`` table if you run into issues and do a manual comparison as the data in the ``systems`` table is relatively smaller in size. | ||
|
||
Notes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. This becomes our TL;DR :)
source/guides/postgres-migration.rst
Outdated
Notes | ||
----- | ||
|
||
Keep in mind that this migration guide primarily focuses on providing step-by-step instructions for the migration; however, it is essential to note that it does not encompass migration configurations for any plugins, such as Focalboard and Playbooks. If your system utilizes these plugins, we highly advise exercising patience until we incorporate the necessary configurations specifically tailored to ensure a smooth transition for those plugins as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This statement partially overlaps the statement above. Consider combining together to avoid content duplication.
@nab-77 Yes! I'll refresh my memory on how that's achieved and apply it to this content. |
Newest code from cwarnermm has been published to preview environment for Git SHA ab17b6b |
Co-authored-by: Carrie Warner (Mattermost) <[email protected]>
Newest code from isacikgoz has been published to preview environment for Git SHA 3ebe2c3 |
Newest code from isacikgoz has been published to preview environment for Git SHA 20ca30f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few thoughts/ideas added.
.. code:: bash | ||
|
||
pgLoader migration.load > migration.log | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to place a note here to remind users to run the commands to re-create the indexes as noted in lines 113/114?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can add that.
:backlinks: top | ||
:local: | ||
:depth: 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a known issues table might be a good addition here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to collect as much as known issues and tried to address "Schema diffs" section. I think we can add a section for known issues & troubleshooting once these gets accumulated.
-------------------- | ||
|
||
- Backup your MySQL data. | ||
- Confirm your Mattermost version. See the **About** modal for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@isacikgoz do we have a min MM version we would recommend? I would certainly like to call out being on a supported ESR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can add that, for now it looks like the minimum support version is v6.4
ESR as we require morph based schema migrations. So if they have version before v6.4
they need to upgrade it first, then conduct the migration. Shall we add that info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nab-77 added a note 👍
- Confirm your Mattermost version. See the **About** modal for details. | ||
- Determine the migration window needed. This process requires you to stop the Mattermost Server during the migration. | ||
- See the `schema-diffs <#schema-diffs>`__ section to ensure data compatibility between schemas. | ||
- Prepare your PostgreSQL environment by creating a database and user. See the `database </install/prepare-mattermost-database.html>`__ documentation for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@isacikgoz do we have a preference for pgsql version here? (outside of ensuring its a supported version).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think minimum version that we support is fine, but the latest supported version would be our preference as far as I'm concerned. Do you think we should provide a specific version?
|
||
Once we set the schema to desired state, we can start migrating the **data** by running ``pgLoader`` \*\* | ||
|
||
\*\* Use the following configuration for the baseline of the data migration: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@isacikgoz what are you thoughts on us providing the migration.load template for users to download/edit? Link here maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template is actually on the repo, being used by the workflow: https://github.com/mattermost/mattermost/blob/master/server/tests/template.load we can add the link here.
Newest code from isacikgoz has been published to preview environment for Git SHA cfe431f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is such a great addition to the docs! I've provided editorial feedback inline. Approving for expediency.
@isacikgoz - @nab-77 had requested that the commands and code samples follow our new approach in the docs, as seen in this screenshot: The code block text is formatted using a special class called
|
Newest code from cwarnermm has been published to preview environment for Git SHA 54e0b49 |
Co-authored-by: Carrie Warner (Mattermost) <[email protected]>
Newest code from isacikgoz has been published to preview environment for Git SHA 5c82614 |
Newest code from isacikgoz has been published to preview environment for Git SHA 4f040b4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cwarnermm I think we can push this now.
Nav location: https://docs.mattermost.com/guides/administration.html#self-hosted-administration
Newest code from cwarnermm has been published to preview environment for Git SHA 7b7a9eb |
Summary
Add the initial version (exluding plugins) of MySQL to PostgreSQL migration guide.
Ticket Link
https://mattermost.atlassian.net/browse/MM-54161