I have been running Discourse in a Kubernetes cluster for a while using the unsupported Bitnami image. Now that Bitnami are deprecating the image and going behind a paywall I am looking to migrate our server to a self-hosted solution on AWS.
I have a few questions that I would be grateful if the community could help with:
We use an external Postgres DB already for the installation and so this will stay in place. However, we updated some settings via the UI and also using environment variables that the Bitnami installation scripts maps to the Discourse, for example DISCOURSE_S3_BACKUP_BUCKET maps to S3_BACKUP_BUCKET.
Is it good enough to set the Discourse settings in the required yaml files or should we still use env vars?
If we do a backup from the UI what will that actually restore - does it update the database?
Is it better to create a brand new database with a fresh install and then do a backup/restore?
If the new install is a later version of Discourse will that cause a problem if a restore is attempted?
The standard installation guide uses Docker - how do you monitor the containers in a production environment as it looks like the standard install is a single VM with Docker.
Are there any documents that detail a migration and any gotchas?
Am sure I will have more questions as the migration goes on but any advice/help that can be given would be really appreciated.
If by “better” you mean “will this mean that I won’t break our existing site and leave it in a state where it will never work again?”, the answer is yes.
That’s what you want. The place you restore from has to be the same or newer than the backup version. It’ll migrate the database after it’s restored.
This might be all you need to know and we’re happy to help here for free. If you’d like hands-on your-setup-specific attention, you can contact me or ask for help in Marketplace.
Also, another option would be to build images and launch those in k8s. I’ve done that a few times and used github to build the images.
My experience concurs. I have seen so many strange little failures over the years that I always maintain full backups such that I can start from scratch and restore the site. Relying on fixing problems in situ will eventually fail you.
Like you, I was left in the lurch when Bitnami stopped offering free images and charts. I had to adapt and migrate so many deployments. One of them was my Discourse deployment. If it is useful to you, here is a link to the replacement Helm chart I created in a very short amount of time (meaning that it works but is far from an ideal design). It is an attempt to use the “official installation method” given that I have seen no “community standard” Helm chart emerge after all these years. (I suppose Bitnami’s chart was effectively that standard, because few of us predicted this abrupt change.) In any case, this new chart that I am running for one of my research communities is basically just a pod with two containers: the official Docker-in-Docker container and a custom container based on python:3, installing Docker and then using the official Discourse installation. Because all the components (Discourse server, Redis, PostgreSQL) run in the black box of the locally image built by the launcher script, there is no scalability or support for high-availability. I did manage to reduce the downtime due to the pod respawning on another node (e.g. when draining node for OS updates or a node crash) by using docker save to store the built image on the persistent volume, and then loading that if local_discourse/app:latest is not found.
But to answer your question, I do not know how to monitor anything in this new deployment. I am running “in production” but my community is small enough and the usage moderate enough that if the forum goes offline for a while, it is not a big deal. Even so, I am very close to abandoning self-hosting and migrating to a service like Communiteq or Discourse.org.