Created Upgrade from 2.4.2 to 2.5.1 on AWS Ubuntu 18.04 LTS (markdown)

Ivan Habernal 2020-09-26 20:46:40 +02:00
parent 2ba999066a
commit 14960e2f8f

@ -0,0 +1,75 @@
Preliminaries: I had `Tracks 2.4.2` running with `sqlite3` backend using SSH (Let's encrypt)
```bash
$ 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`
```bash
$ nano Gemfile
```
Comment out unused backends
```
# gem "mysql2", "~> 0.5.3", group: :mysql
# gem "pg", "~> 1.2.3", group: :postgresql
```
```bash
$ 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
```
```bash
$ 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).
```bash
$ export RAILS_SERVE_STATIC_FILES=true
$ bundle install
```
Copy the previous sql file and run db migrate
```bash
$ 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'
```