Ubuntu 16.04 LTS - upgrade or migrate?

I’ve finally found a moment to breathe between my various other projects, which means I’ve a few idle cycles to think about our Discourse environments and how, when or if we should approach the Ubuntu 16.04 LTS upgrade.

Ubuntu 14.04 is supported through until late 2019, so there’s no huge rush to accomplish this, but I like to check in on such topics and at least be aware of the potential risks and benefits. From what I can see elsewhere 16.04 is officially supported for fresh installations, but has anyone weighed up upgrading the OS versus migrating the Discourse install to a clean box?

From what I can gather, hosts such as DO will leave 16.04 machines on an older kernel that may not be upgradable for some time, are there any other gotchas?

Has anyone successfully upgraded their machines from 14.04->16.04? What state was Discourse in post-install?

I did an upgrade on two droplets on DO for a client. I had a bit of an issue with Docker that I had to reinstall on one droplet (I didn’t do the install and I had trouble with Docker on this droplet before that) but other than that, it went well on both. No trouble with the database or anything else. If you do a backup or even better a snapshot, you don’t have to worry.

The duration was about 15 minutes. The forum is still running the first minutes, but not for the rest.

If I remember correctly, you may have to do a

cd /var/discourse
./launcher restart app

After the upgrade, but I’m not sure.

2 Likes

I upgraded from 14.04->16.04 on a DO droplet. All went well except I had to add the new repository for Xenial for Docker and update it. Did a restart app as @Steven said and I was up and running again.

All your third party apt repositoires will be disabled when you upgrade as you need to point them to new Xenial ones if needed.

3 Likes

On my Windows 10 localhost set-up I installed VMware Player.
I created a VM using the ubuntu-16.04-desktop-amd64.iso image.
I then installed Discourse following https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md but skipping the “cloud server” stuff.

The “Discourse Advanced Developer Install Guide” has

To get your Ubuntu 16.04 LTS install up and running to develop Discourse and Discourse plugins follow the commands below.

So based on that and my not having had any noticeable problems using Ubuntu 16.04 LTS on my localhost, I think either version would work OK.

Just the same, to be safe I think it would be wise to try 16.04 in a staging set-up before making the switch on a live site.

FWIW, I’ve clean installed docker+discourse on clean 16.04 LTS without any glitches.

1 Like

The only minor issue I’ve had on 16.04 (clean or upgraded) is that when I reboot the droplet (only on droplets who have a swap), the forum takes ~5 minutes to come back instead of 1 min on 14.04.

It’s more a Ubuntu issue tho.

Is it necessary to upgrade to 16.04 LTS or i could stay with v14.04 itself?

2 Likes

I was debating upgrading my 14.04 install, but was’t sure if I should. However, when I updated docker, it broke my discourse setup.

I attempted to upgrade using the script from the notes How do I manually update Discourse and Docker image to latest?

wget -qO- https://get.docker.com/ | sh

Error!

/usr/bin/docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:297: copying bootstrap data to pipe caused \"write init-p: broken pipe\"": unknown.
Your Docker installation is not working correctly

See: https://meta.discourse.org/t/docker-error-on-bootstrap/13657/18?u=sam

I noticed on Docker’s website the minimum verison was Ubuntu 16.04.

I attempted to downgrade docker back to what I had (17.05.0~ce-0~ubuntu-trusty), but couldn’t get it to work with this command:

sudo apt-get install docker-ce=17.05.0~ce-0~ubuntu-trusty docker-ce-cli=17.05.0~ce-0~ubuntu-trusty containerd.io

Everyone seems to recommend a fresh install, but I don’t know how to do that with my limited experience with Digital Ocean/Ubuntu … and all the steps it seems to require.

So in my final attempt I updated Ubuntu 14.04 to 16.04 and everything worked again with Docker.

do-release-upgrade

Note: I backed up everything after updating my Discourse install, before I attempted to install system updates.

Yep, my standard practice now for any OS dot release is an in-place upgrade, for anything more I just move backups to a new server, copy the yml files over and reinstall. It’s very quick, and almost completely painless.

7 Likes

Are you hosting on Digital Ocean or elsewhere? What process do you follow when you migrate to a new server?

It seemed like a lot more hoops to jump through with Digital Ocean in having to spin up a new Droplet, migrate, and spin-down? an older server.

Sure, that’s exactly what you do, just re-run the 30 minute install, which thee days takes me 10 minutes or less, copy over your yml, repoint DNS and restore the backup.

We’re talking about an operation you do once every couple of years at best, if you’re trying to minimise risk of an OS upgrade hosing docker it’s a small price to pay.

Servers costs are prorated, and you’re not going to parallel run for long at all.

7 Likes

Thanks! I’ll give that a try next time. I haven’t done this much before, so it’s challenging when issues pop up.

1 Like

I just migrated to a new server for one of my personal Discourse sites, and while I was at it, we did a complete pass on the #howto docs for migrating your Discourse from server to server (via backups) recently. They’re in very good shape. :hugs:

5 Likes