How do you keep Discourse up to date? (self-hosted)


(Erlend Sogge Heggen) #1
  1. Discourse itself should be updated about twice a month, by clicking the “Update to Latest Version” button in your admin dashboard. We do beta releases roughly once every week.

  2. Every two months we recommend SSH’ing in and doing

     cd /var/discourse
     git pull
     ./launcher rebuild app
    
  3. As for Ubuntu updates, make sure you have automatic security updates enabled for your Ubuntu! The command is:

    dpkg-reconfigure -plow unattended-upgrades

    However, that just covers critical security updates. Every so often you should get all the OS updates like so:

     apt-get update
     apt-get dist-upgrade
    

    This is completely safe, we have never seen anything get broken by base Ubuntu updates.

To summarize:

  • update Discourse twice a month via web updater
  • update the container every two months
  • update the OS every six months

You could double these numbers and still be fairly safe, e.g. update Discourse once a month, container every 4 months, OS once every 12 months, and so on.

But you really, really want automatic security updates enabled in Ubuntu, as listed above – all our Digital Ocean “one-time installs” already have automatic security updates set up.

FAQ

What is the right time to update?

It just depends on the time you have available and how close to bleeding edge you want to be. If you have non-official plugins, it is highly advisable to utilize a test/staging site. If you do not have any non-official plugins, you can likely upgrade immediately, but even then, some plugins may break for a couple of days as the team fixes them (there are a lot of them).

What is common practice when updating with many plugins installed?

If you have a lot of plugins, testing locally or on a test server is highly advised. Especially if you have non-official plugins, as something could have broke. If you find something does break, then it is a matter of, do you have time to fix it? Does the original plugin author have time to fix it? Either of those could take weeks. So at least this way, you simply have a broken test site and not a broken production site.


Docker and Discourse upgrade
How often do you update your installation? (tests-passed)
Discourse version upgrade from 1.6.3 to 1.8.0
(Jesse Perry) #2

Thanks for putting this together. Does updating the actual server version of Ubuntu matter since Discourse always operates in Docker? I have zero to no technical knowledge on how Docker works, but I was noticing that with the new container image ( Discourse Docker Image version 1.3.3, released), it had a separate version of Ubuntu and that wasn’t an issue.


(Jeff Atwood) #3

It matters a lot less. But I would not get so far behind that, say, you are on Ubuntu 12.04 LTS today, which was released in mid-2012, four years ago. That version will be end of support life by early 2017.


(Viktor Benei) #4

Is there a recommendation for (or against) read-only mode during the upgrade?

Is it safe to do the upgrade after enabling read-only mode, or could read-only mode cause issues with the upgrade (e.g. not letting things to upgrade or similar)?


(Joshua Rosenfeld) #5

I don’t enable read-only mode before upgrades, and I’m not aware that it is a common thing to do. If upgrading from the web (docker_manager), read-only mode will be enabled automatically when needed by the update process. On a typical site, the length of time read-only mode is on is incredibly short - generally not even noticible.


(Erlend Sogge Heggen) #6

We have a duplicate tutorial with much better SEO juice here:

Merged the contents of this topic in there. Should probably set up a redirect eventually.


(Erlend Sogge Heggen) #7