Updating Discourse on CentOS

I have one forum using Discourse, as a test for this new platform, for OS I use CentOS. Discourse official documentation to updating the site is using Ubuntu so there are a few changes need to be done for CentOS.

My SSH login name is Discourse and the installation folder is inside the Discourse folder, example url

/home/discourse/discourse

Here's how to update Discourse to the latest version:

# Run these commands as the discourse user
bluepill stop
bluepill quit

# Back up your install
DATESTAMP=$(TZ=UTC date +%F-%T)

pg_dump --no-owner --clean discourse_prod | gzip -c > ~/discourse-db-$DATESTAMP.sql.gz

tar cfz ~/discourse-dir-$DATESTAMP.tar.gz -C /home/discourse discourse

# Get the latest Discourse code
cd discourse
git checkout master
git pull
git fetch --tags

# To run on the latest numbered release instead of bleeding-edge:
# git checkout latest-release

# Merge the sample configuration just in case if there is an update. Run these commands as the discourse user

diff -u config/discourse_defaults.conf config/discourse.conf

diff -u config/discourse.pill.sample config/discourse.pill

diff -u config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf

# Begin upgrade
bundle install --without test --deployment

RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production bundle exec rake db:migrate

RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production bundle exec rake assets:precompile

RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ROOT=/home/discourse/discourse RAILS_ENV=production NUM_WEBS=2 bluepill --no-privileged -c ~/.bluepill load /home/discourse/discourse/config/discourse.pill

# Restart bluepill
crontab -l

Author: danpros

A self-proclaimed geek, business owner, and part-time blogger.

Comments on “Updating Discourse on CentOS”