Mattermost / Backup / Postgres / S3
I really hope somebody could explain to me the bits and bolts of Cloudron in terms of app backups because I couldn't figure it out myself with the docs.
Right now we run our own instance of Mattermost on top of Postgres and store our binary files in S3 (on Caprover). We plan to move all our apps to Cloudron.
I am aware that on Cloudron the default setup is with MySQL and the file storage instead of S3 and the easiest way is probably to export from our existing instance in import into Cloudron.
However, I would like to keep the files in S3 and maybe even continue to use Postgres, if possible, which is also available on Cloudron. The easiest way to achieve this is probably to adjust the config.json file of Mattermost.
My question is: Since I would like to facilitate backups and other features provided by Cloudron, I would like to understand how the backups work under the hood: Would it be enough to just create a database in Postgres and adjust the URI in config.json, or would it indeed be better to migrate to MySQL? And especially how to proceed with the binary files and S3, which I would like to keep there. Or should I somehow copy them to the file system? Or keep them in S3 without backups through Cloudron?
Thanks a lot!
its not quite as easy (or should I say its not designed to work this way?). In Cloudron apps have access to so called "addons". These could be for mail access, local data storage or for databases.
The Mattermost app has (among others) the mysql addon configured. Which also makes sure to create a database and a user for it on the Cloudron side and make sure that these are included in the backup of the app itself.
You could of course configure the app to use S3 for storage and also a different database (but the database would be overwritten during app startup, so that would be rather pointless). Plus if you configure an S3 storage, this would not be part of the Cloudron backup and needed to be handled separately (just as any extra database).
Since the strength of Cloudron is the automation around app setup/backup/update so I would rather recommend to use it like it comes out of the box.
Mattermost includes a tool to export and import data since a few releases. Maybe this would be a good way to move from your external setup to one that is hosted on Cloudron? https://docs.mattermost.com/manage/mmctl-command-line-tool.html#mmctl-export
@fbartels Thank you very much. I guess I'll try the official way. Thanks for pointing out the functionality of add-ons.
@mtd-sales let us know if you have trouble importing/exporting via mattermost CLI. One thing is that you want the version of mattermost you are running now and the one on Cloudron to match. On Cloudron side, if you look at the https://git.cloudron.io/cloudron/mattermost-app/-/blob/master/CHANGELOG it will tell you the package version. Then, you can change the package version in the URL bar of your dashboard when installing an app (i.e click the mattermost app in App Store and then change the version field in the URL).
As for storing things in S3, I think you have to decide whether you prefer files stored externally or on the server itself. The main difference is with respect to backups. If on server, Cloudron will include them in the backup and restore will also work properly. But if it's in an external service, the backup won't include them and thus restore might be complicated. Like if you restore to a mattermost from a week ago, I am not sure how you roll back S3 storage to a week ago (especially, if you had deleted files in the middle). I guess the compromise you make depends on your use case.