Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

How To Upgrade Manually

Tim Morgan edited this page Sep 18, 2017 · 6 revisions

For first-time installs, see Installation.

If you installed manually, or if you installed on Digital Ocean or as an Amazon AMI before March 2016, then the following instructions are to be followed to upgrade to a newer release.

IMPORTANT: you must incrementally upgrade from one point release to another. If you are on an especially old release, you might want to Upgrade by Copying Data instead.

Upgrading from 3.8.0 to 3.9.0 (not yet released)

  1. Upgrade Node to a newer version:

    curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
    sudo apt-get install -y nodejs
  2. Install Yarn (for managing JavaScript dependencies):

    curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
    echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
    sudo apt-get update
    sudo apt-get install -y yarn
  3. Upgrade:

    cd /var/www/onebody
    git fetch origin
    git checkout 3.9.0
    # upgrade bundler
    sudo gem install bundler
    bundle install --deployment
    yarn install
    RAILS_ENV=production bundle exec rake db:migrate
    RAILS_ENV=production bundle exec rake tmp:clear assets:precompile
    touch tmp/restart.txt

Upgrading from 3.7.0 to 3.8.0

  1. OneBody now looks for the X-Forwarded-Proto header to determine if the connection is secure. Your existing nginx config will need proxy_set_header X-Forwarded-Proto $scheme; added.

  2. The default nginx config now sets client_max_body_size 80m; to match increased document sizes of 75mb.

Make both of these changes to your nginx config (/etc/nginx/sites-available/onebody) so that it looks like this:

upstream onebody {
    # -snip-
}

server {
    listen 80;
    client_max_body_size 80m;                                     # <---- change this line to 80m

    location / {
        proxy_pass http://onebody;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;               # <---- add this line
    }
}

Be sure to restart nginx with systemctl restart nginx

Last, upgrade OneBody:

cd /var/www/onebody
git fetch origin
git checkout 3.8.0
bundle install --deployment
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake tmp:clear assets:precompile
touch tmp/restart.txt

Upgrading from 3.6.0 to 3.7.0

  1. Upgrade OneBody:

    cd /var/www/onebody
    git fetch origin
    git checkout 3.7.0
    bundle install --deployment
    RAILS_ENV=production bundle exec rake db:migrate
    RAILS_ENV=production bundle exec rake tmp:clear assets:precompile
    touch tmp/restart.txt
  2. The encoding used for string/text columns in the database has changed. The migration to update the encoding can take quite awhile, especially if you have a lot of data in your database. Also be sure to make a backup of your database (see https://github.com/churchio/onebody/wiki/Backups for help).

  3. Imports were not being properly scoped by site id before, and now they are. You will need to manually fix any imports to point to the proper site. For most people, the following should work:

    cd /var/www/onebody
    rails console production
    [1] pry(main)> Import.unscoped.update_all('site_id = 1')
      SQL (0.7ms)  UPDATE `imports` SET site_id = 1
    => 23
    [2] pry(main)> exit
    

Upgrading from 3.5.0 to 3.6.0

cd /var/www/onebody
git fetch origin
git checkout 3.6.0
bundle install --deployment
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake tmp:clear assets:precompile
touch tmp/restart.txt

Upgrading from 3.4.0 to 3.5.0

cd /var/www/onebody
git fetch origin
git checkout 3.5.0
bundle install --deployment
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake tmp:clear assets:precompile
touch tmp/restart.txt

Note: We switched back to using bundle install --deployment, and upgrade instructions above include it.

If your admin dashboard isn't working, fix the permission on your tmp/cache folder: chmod -R 777 /var/www/onebody/tmp.

Upgrading from 3.3.0 to 3.4.0

cd /var/www/onebody
git fetch origin
git checkout 3.4.0
rm -rf vendor/bundle
bundle install
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake tmp:clear assets:precompile
touch tmp/restart.txt

Note: This is the first version that started using bundle install instead of bundle install --deployment.

If there is an error with bundle install, then run bundle install --no-deployment && bundle update && bundle install (see here).

We've had many reports of messed up permissions on the tmp/cache folder. This will cause an error when trying to view the admin dashboard. To fix, run: chmod -R 777 /var/www/onebody/tmp.

Upgrading from 3.2.0 to 3.3.0

cd /var/www/onebody
git fetch origin
git checkout 3.3.0
bundle install --deployment
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake tmp:clear assets:precompile
touch tmp/restart.txt

Upgrading from 3.1.0 to 3.2.0

  1. Be sure you are upgrading from a OneBody version of 3.0.0 or later. If you are upgrading from a version in the 2.x series, you will need to first completely upgrade to 3.0.0, then upgrade to this version.

  2. Upgrade OneBody:

    cd /var/www/onebody
    git fetch origin
    git checkout 3.2.0
    bundle install --deployment
    RAILS_ENV=production bundle exec rake db:migrate
    RAILS_ENV=production bundle exec rake tmp:clear assets:precompile
    touch tmp/restart.txt
  3. Set your "Default Country" in the admin dashboard Settings screen.

  4. Run the following rake task to set your country on all existing family records:

    RAILS_ENV=production bundle exec rake onebody:set_country

Upgrading from 3.0.0 to 3.1.0

  1. Upgrade OneBody:

    cd /var/www/onebody
    git fetch origin
    git checkout 3.1.0
    bundle install --deployment
    RAILS_ENV=production bundle exec rake db:migrate
    RAILS_ENV=production bundle exec rake tmp:clear assets:precompile
    touch tmp/restart.txt
  2. Add secret_key_base to your secrets.yml file. See secrets.yml.example for an example.