Canvas LMS/Upgrading

From r00tedvw.com wiki
Revision as of 00:08, 15 January 2016 by R00t (Talk | contribs)

Jump to: navigation, search

Contents

Instruction source

All instructions are from the Canvas LMS Github wiki

Requirements

These upgrade instructions make the following assumptions:

  1. you installed canvas lms via git
  2. redis is running at a version greater than 2.6
  3. you are logged in as the original user who installed canvas and ran the git and gem installs
  4. you've created a backup or snapshot before continuing
  5. there are no local changes you've made to the canvas code that are different than the stable version on github

Upgrade Source

Start by logging in as the original user that installed Canvas. This is very important as you'll encounter permission issues with git.

~/var/canvas$ git fetch && git reset --hard origin/stable
...
HEAD is now at da056ac treesame commit of origin/stable/2016-01-09

Upgrade and Install Bundled Gems

~/var/canvas$ bundle install

If you get the same error as I did:

/var/canvas$ bundle install
Fetching source index from https://rubygems.org/
Resolving dependencies.....
You have requested:
  addressable = 2.3.8

The bundle currently has addressable locked at 2.3.5.
Try running `bundle update addressable`

Then instead first run:

~/var/canvas$ bundle update addressable

and you should get:

Your bundle is updated!
Gems in the groups sqlite and mysql were not installed.

Follow that up with:

~/var/canvas$ bundle install

and you should get:

Your bundle is complete!
Gems in the groups sqlite and mysql were not installed.
It was installed into ./vendor/bundle

Upgrade and Install Node Modules

~/var/canvas$ npm install

Complied Assets

~/var/canvas$ RAILS_ENV=production bundle exec rake canvas:compile_assets

If you get an error:

rake aborted!
Undumpable Exception -- #<Errno::EACCES: Permission denied @ rb_sysopen - /var/canvas/config/domain.yml>

Then you'll need to temporarily change permissions to allow the update:

/var/canvas$ sudo chmod 660 ./config/domain.yml

The above makes the assumption that the user you are logged in as is either the file owner or part of the group owner.
Once the permission is set, try to upgrade again. If successful then:

/var/canvas$ sudo chmod 400 ./config/domain.yml

Database Migrations

~/var/canvas$ RAILS_ENV=production bundle exec rake db:migrate

If you get an error:

rake aborted!
Errno::EACCES: Permission denied @ rb_sysopen - /var/canvas/config/cache_store.yml
Errno::EACCES: Permission denied @ rb_sysopen - /var/canvas/config/redis.yml
Errno::EACCES: Permission denied @ rb_sysopen - /var/canvas/config/database.yml
encryption key required, see security.yml.example
Errno::EACCES: Permission denied @ rb_sysopen - /var/canvas/config/outgoing_mail.yml
Errno::EACCES: Permission denied @ rb_sysopen - /var/canvas/config/file_store.yml
StandardError: An error has occurred, this and all later migrations canceled:

Just like before, you'll need to set the appropriate permissions:

/var/canvas$ sudo chmod 660 ./config/*.yml

The above makes the assumption that the user you are logged in as is either the file owner or part of the group owner. I was not, so I had to:

/var/canvas$ sudo chown canvasuser:canvasgroup ./config/*.yml

Once the permission is set, try to upgrade again. If successful then:

/var/canavs$ sudo chown canvasuser:canvasgroup ./config/*.yml
sudo chown canvasuser:canvasgroup ./config/cache_store.yml
sudo chown canvasuser:canvasgroup ./config/redis.yml
/var/canvas$ sudo chmod 400 ./config/*.yml

Notification types

~/var/canvas$ RAILS_ENV=production bundle exec rake db:load_notifications

If you get an error:

rake aborted!
Errno::EACCES: Permission denied @ rb_sysopen - /var/canvas/config/brandable_css.yml

Just like before, you'll need to set the appropriate permissions:

/var/canvas$ sudo chmod 660 ./config/*.yml

The above makes the assumption that the user you are logged in as is either the file owner or part of the group owner. I was not, so I had to:

/var/canvas$ sudo chown canvasuser:canvasgroup ./config/*.yml

Once the permission is set, try to upgrade again. If successful then:

/var/canavs$ sudo chown canvasuser:canvasgroup ./config/*.yml
sudo chown canvasuser:canvasgroup ./config/cache_store.yml
sudo chown canvasuser:canvasgroup ./config/redis.yml
/var/canvas$ sudo chmod 400 ./config/*.yml
Personal tools
Namespaces

Variants
Actions
Navigation
Mediawiki
Confluence
DevOps Tools
Ubuntu
Ubuntu 22
Mac OSX
Oracle Linux
AWS
Windows
OpenVPN
Grafana
InfluxDB2
TrueNas
OwnCloud
Pivotal
osTicket
OTRS
phpBB
WordPress
VmWare ESXI 5.1
Crypto currencies
HTML
CSS
Python
Java Script
PHP
Raspberry Pi
Canvas LMS
Kaltura Media Server
Plex Media Server
MetaSploit
Zoneminder
ShinobiCE
Photoshop CS2
Fortinet
Uploaded
Certifications
General Info
Games
Meal Plans
NC Statutes
2020 Election
Volkswagen
Covid
NCDMV
Toolbox