-
Notifications
You must be signed in to change notification settings - Fork 283
How To Upgrade Manually
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.
-
Upgrade Node to a newer version:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs
-
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
-
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
-
OneBody now looks for the
X-Forwarded-Proto
header to determine if the connection is secure. Your existing nginx config will needproxy_set_header X-Forwarded-Proto $scheme;
added. -
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
-
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
-
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).
-
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
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
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
.
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
.
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
-
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.
-
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
-
Set your "Default Country" in the admin dashboard Settings screen.
-
Run the following rake task to set your country on all existing family records:
RAILS_ENV=production bundle exec rake onebody:set_country
-
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
-
Add
secret_key_base
to yoursecrets.yml
file. See secrets.yml.example for an example.