How do I upgrade Discourse in a multiple container configuration?

Hello! I’ve just got a fresh multiple container Discourse install going and I’m wondering what my best upgrade method might be.

The documentation says:

Minimize downtime when upgrading to new versions of Discourse. You can bootstrap new web processes while your site is running and only after it is built, switch the new image in.

As I read this, I wonder if this means that it’s safe to run a previous version of Discourse live while the other container upgrades?

For example:

Let’s say I have two web-only containers running on separate VMs behind a load balancer. I take one of the container instances out of the load balancers, and I run bootstrap on the latest version. The old version is still in service for zero downtime (is that okay?). Next, I restore the updated container to the load balancer, and repeat the process on the other container.

That sounds about right, doesn’t it?

1 Like

That’s about right. For true zero downtime upgrades, you need to bootstrap the new container with SKIP_POST_DEPLOYMENT_MIGRATIONS: 1, then launch, then, after the old containers are no longer running, run a SKIP_POST_DEPLOYMENT_MIGRATIONS=0 rake db:migrate. Otherwise, the bootstrap can (but does not for every upgrade) put the database in a state that the old container can’t use anymore.

1 Like

Oh that’s awesome! Database migrations were exactly my concern, so it’s helpful to know how to control them!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.