Mattermost
Section titled “ Mattermost”Mattermost is an open source, self-hosted Slack-alternative.
- Questions? Ask in the Cloudron Forum - Mattermost
- Mattermost Website
- Mattermost forum
- Mattermost docs
- Mattermost issue tracker
Config
Section titled “Config”The config file is located at /app/data/config.json. Edit it using the File manager.
Restart the app after making changes to the config file.
Command line tool
Section titled “Command line tool”The Mattermost CLI tool administers user and team management tasks.
Starting Mattermost 6.0, install the CLI tool locally on your Mac/PC. See the CLI docs for downloading the binaries.
Once installed, run mmctl:
/app/code/mmctl auth login https://mattermost.cloudron.space --name myserver --username adminPassword:
credentials for "myserver": "admin@https://mattermost.cloudron.space" storedRun commands like mmctl team list.
Migrate external instance
Section titled “Migrate external instance”To migrate your existing non-Cloudron mattermost installation to Cloudron, use the bulk export/import functionality of mmctl.
Caveats:
- plugins, integrations, webhook, custom message formats, system settings have to be setup again
- User passwords are not migrated. All users have to reset their password in the new instance.
Export external instance
Section titled “Export external instance”Export data from the old installation using mmctl.
mmctl can be installed on your PC/laptop.
mmctl auth login https://mmold.instancemmctl export createExport process job successfully created, ID: 8qxfhwmrejnkij3rbqzpo1q7wymmctl export list8qxfhwmrejnkij3rbqzpo1q7wy_export.zipmmctl export download 8qxfhwmrejnkij3rbqzpo1q7wy_export.zipImport to Cloudron instance
Section titled “Import to Cloudron instance”Install mattermost on Cloudron. Because we don’t have any users yet to login and authenticate, we must use the local socket to authenticate with mattermost.
-
Change
EnableLocalModeto true in/app/data/config.jsonandLocalModeSocketLocationto/tmp/mattermost_local.socketusing the File manager and restart the app. -
Open a Web Terminal .
-
Upload the export file to `/tmp’.
-
Import using the
mmctlbinary.
cd /tmpcurl -L https://releases.mattermost.com/mmctl/v9.8.0/linux_amd64.tar | tar xvf -export MMCTL_LOCAL_SOCKET_PATH=/tmp/mattermost_local.socket./mmctl --local import process --bypass-upload /tmp/8qxfhwmrejnkij3rbqzpo1q7wy_export.zipImport process job successfully created, ID: ksy4gtmxqpbgumcw7hd84dcr6r./mmctl --local import job list ID: ksy4gtmxqpbgumcw7hd84dcr6r Status: success Created: 2024-05-31 11:33:09 +0000 UTC Started: 2024-05-31 11:33:19 +0000 UTC Data: map[extract_content:true import_file:/tmp/8qxfhwmrejnkij3rbqzpo1q7wy_export.zip local_mode:true]- Change
EnableLocalModeto false in/app/data/config.jsonand restart the app.
Enterprise
Section titled “Enterprise”Switch to the Enterprise version of Mattermost by editing /app/data/edition.ini using the File manager
and changing edition=enterprise.
Restart the app after making any changes.
Migrate to Postgres
Section titled “Migrate to Postgres”Mattermost has decided to deprecate MySQL support and focus on PostgreSQL support. For this reason, we have made a new package that uses PostgreSQL with appstore id org.mattermost.cloudronapp2 and deprecated the old MySQL package (appstore id org.mattermost.cloudronapp).
Two migration methods are available: Database migration and Export/Import.
Database migration
Section titled “Database migration”For this, use the upstream guide as the reference.
pgloader tool is used to migrate data from MySQL to PostgreSQL. The migration config for pgloader is located at /app/pkg/migration.load . This file is copied from the upstream docs. Double check the content of this file before and the upstream doc before continuing. The main difference is that the upstream docs uses a dot in variables names and this breaks pgloader’s mustache templating.
-
Install a fresh instance of Mattermost. New instances use PostgreSQL by default. You don’t need to stop or delete your existing MySQL installation.
-
In the new instance, open a Web Terminal.
-
Create a folder
/tmp/migration
mkdir -p /tmp/migration- Create a file named
/tmp/migration/context.iniand fill it up like below. You can get the MySQL connection information of your old installation by runningprintenv | grep CLOUDRON_MYSQLin the old instance. You can get the PostgreSQL connection information of your new installation by runningprintenv | grep CLOUDRON_POSTGRESQLin your new instance.
touch /tmp/migration/context.ini[pgloader]mysql_user=f1b2b6873b4dad41mysql_password=f1c879c56c68abb03f77ef26e20b5898fc9bfeb2f87ae358mysql_address=mysql:3306source_schema=f1b2b6873b4dad41
pg_user=userbec36139a3c04f7a97394a5348d4ea87pg_password=d307edc09a68a3a8cd6b7d4a614a4c5bcb2dbe98bef0b7c86ceab55a97691f15c9c246e82e01b2e9f1db44d8d9de0c58cad3de13c169fafcaace2c7b289c6033postgres_address=postgresql:5432target_schema=dbbec36139a3c04f7a97394a5348d4ea87- Download the latest version of the migration-assist in
/tmp/migration
# As of writing this doc version v0.2 is latest, please check for a newer versioncd /tmp/migration/wget https://github.com/mattermost/migration-assist/releases/download/v0.2/migration-assist-Linux-x86_64.tar.gztar xzf migration-assist-Linux-x86_64.tar.gzrm migration-assist-Linux-x86_64.tar.gz- Run the migration:
pgloader --context=/tmp/migration/context.ini /app/pkg/migration.load > /app/data/migration.log-
If the above works (no error output) check the logfile in
/app/data/migration.logfor anything suspicious, include this log in the Forum when reporting errors -
migrate other directories like
files,pluginsfrom the old instance to the new instance. You can do this using the File Manager’s download and upload functionality. Plugin specific migration is covered in upstream docs. -
Restore full-text indexes with the
migration-assistby getting the PostgreSQL connection URL fromprintenv CLOUDRON_POSTGRESQL_URLand running themigration-assistas following
# migration-assist postgres post-migrate "<POSTGRES_DSN>"# The <POSTGRES_DSN> is the output of printenv CLOUDRON_POSTGRESQL_URL# WATCHOUT! you will have to add ?sslmode=disable at the end of the POSTGRES_DSNmigration-assist postgres post-migrate "postgres://userPLACEHOLDER:PLACEHOLDERPASSWORD@postgresql/dbPLACEHOLDER?sslmode=disable"- Restart mattermost and test the whole installation before moving your new installation to the desired location.
Bulk export/import
Section titled “Bulk export/import”This approach is more portable and safer.
Known limitations:
-
plugins, integrations, webhook, custom message formats, system settings have to be setup again
-
User passwords are not migrated. All users have to reset their password in the new instance.
Steps to migrate are very similar to Migrating an External Instance:
-
Export the existing MySQL installation using the same procedure as Export External Instance.
-
Install a fresh instance of Mattermost. New instances use PostgreSQL by default. You don’t need to stop or delete your existing MySQL installation.
-
In the new instance, import using the same procedure as Import to Cloudron Instance.
-
Note that you have to reset the password to login in the new instance. Once you are satisfied that data is intact, you can move over the app to your existing location. We recommend stopping the MySQL instance and moving it to another location and keeping it around for some time.