Skip to content

Upgrade from 2.4.2 to 2.5.1 on AWS Ubuntu 18.04 LTS

Ivan Habernal edited this page Sep 26, 2020 · 1 revision

Preliminaries: I had Tracks 2.4.2 running with sqlite3 backend using SSH (Let's encrypt)

$ wget https://github.com/TracksApp/tracks/archive/v2.5.1.zip
$ unzip v2.5.1.zip
$ cd tracks-2.5.1/
$ rm Gemfile.lock

Edit Gemfile, I'm using nano

$ nano Gemfile

Comment out unused backends

# gem "mysql2", "~> 0.5.3", group: :mysql
# gem "pg", "~> 1.2.3", group: :postgresql
$ cp config/database.yml.tmpl config/database.yml
$ nano config/database.yml

Change to use sqlite backend

production:
#  adapter: mysql2
# database: tracks
  # set this if you are storing utf8 in your mysql database to handle strings
  # like "Réné".Not needed for sqlite. For PostgreSQL use encoding: unicode
  # encoding: utf8
#  host: localhost
#  username: root
#  password:

# The following is an example to configure Tracks to use sqlite

#production:
  adapter: sqlite3
  database: db/tracks-20-blank.sqlite3.db
  pool: 5
  timeout: 5000
$ cp config/site.yml.tmpl config/site.yml
$ nano config/site.yml

Change change-me in secret_token to some random value. Then compile packages (takes some time).

$ export RAILS_SERVE_STATIC_FILES=true
$ bundle install

Copy the previous sql file and run db migrate

$ cp ../tracks-2.4.2/db/tracks-20-blank.sqlite3.db db/
$ bundle exec rake db:migrate RAILS_ENV=production
$ bundle exec rake assets:precompile RAILS_ENV=production

I have the following script for launching Tracks properly with SSL:

#!/bin/sh
export RAILS_SERVE_STATIC_FILES=true
bundle exec puma -e production -b 'ssl://0.0.0.0:3000?key=/etc/letsencrypt/live/myserver.com/privkey.pem&cert=/etc/letsencrypt/live/myserver.com/cert.pem'
Clone this wiki locally