Previously, I have used the discourse packages from https://packager.io/gh/pkgr/discourse because that was easy to install and to maintain, just with Ubuntu packages.

Unfortunately, those packages have not been updated for a while.

Another thing is that I can now run docker within an lxc container, which makes it easier for me to deploy docker on my root server.

So I decided to upgrade my pkgr discourse installation from 1.5.1 to the latest stable docker discourse installation.

These threads and pages have helped me:

So I created a backup of the 1.5.1 installation, within the admin dashboard, and downloaded that locally.

I created an LXC container with Fedora 24 (see https://github.com/tpokorra/lxc-scripts/issues/27).

Inside the container:

dnf install docker git which
systemctl enable docker
systemctl start docker
mkdir /var/discourse
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse
# comment last line, because we want to edit the file containers/app.yml before installing
sed -i 's~./launcher bootstrap~#./launcher bootstrap~g' discourse-setup
./discourse-setup
# edit containers/app.yml:
#   comment the line with 443:443 because I am using nginx outside of the LXC container for https
#   in section params, add this line:
#     version: v1.5.1
#   I changed UNICORN-WORKERS from 6 to 2, because my forum does not have much traffic
./launcher bootstrap app && ./launcher start app

Now I login to the new discourse installation, with the admin email address specified in discourse-setup. Checking in the dashboard, I have version 1.5.1 indeed.

I restore the backup that I downloaded from the old server (need to make sure to enable restore first in the dashboard settings!).

Verify that the forum works.

Now upgrade Discourse to the latest stable version:

cd /var/discourse
git pull
sed -i "s/^  version:.*/  version: stable/g" containers/app.yml
./launcher rebuild app
Migrating Discourse from pkgr packages to Docker installation
Tagged on: