Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Upgrading Airnotifier: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
Line 1: Line 1:
Steps to upgrade
Steps to upgrade


- Stop the server, killing the process
* Stop the server, killing the process
<code>
  ps aux | grep airnotifier
  ps aux | grep airnotifier
  kill -9 PROCESS_ID
  kill -9 PROCESS_ID
</code>


- Backup the mondodb databases
* Backup the MongoDB databases
*# Backup AirNotifier settings database <br/><code>mongodump -h localhost --port 27017 -d airnotifier -o /var/airnotifier/</code>
*# Backup each application data<br/><code>mongodump -h localhost --port 27017 -d commoodlemoodlemobile -o /var/airnotifier/;</code><br/><code>mongodump -h localhost --port 27017 -d commoodlemoodlemobiletest -o /var/airnotifier/</code>


Applications list database
* Pull latest version from git
mongodump -h localhost --port 27017 -d airnotifier -o /var/airnotifier/
<code>
Each application database
mongodump -h localhost --port 27017 -d commoodlemoodlemobile -o /var/airnotifier/
mongodump -h localhost --port 27017 -d commoodlemoodlemobiletest -o /var/airnotifier/
 
Pull latest version from git
  cd /opt/airnotifier
  cd /opt/airnotifier
  git pull
  git pull
</code>


Check that your current version has a version number in the options collection (Airnotifierdatabase) (Older Airnotifier versions doesn't have it), use the shell:
* Check that your current version has a version number in the options collection (AirNotifier settings database) (Older AirNotifier versions doesn't have it), use the shell:
  mongo
  mongo
  use airnotifier
  use airnotifier
  db.options.find()
  db.options.find()


If there is not a value option, create a new one:
* If there is not a value option, create a new one:
  db.options.insert({name: "version", value: 20140101})
  db.options.insert({name: "version", value: 20140101})


Run the upgrade.py script
* Run the upgrade.py script
  cd /opt/airnotifier
  cd /opt/airnotifier
  python upgrade.py
  python upgrade.py


Start the server again
* Start the server again
  ./startserver
  ./startserver
or
or
  sudo -u airnotifier python airnotifier.py >> /var/airnotifier/console_log 2>> /var/airnotifier/error_log &
  sudo -u airnotifier python airnotifier.py >> /var/airnotifier/console_log 2>> /var/airnotifier/error_log &
[[Category: Mobile]]
[[Category: Mobile]]

Revision as of 16:19, 18 October 2014

Steps to upgrade

  • Stop the server, killing the process

ps aux | grep airnotifier
kill -9 PROCESS_ID

  • Backup the MongoDB databases
    1. Backup AirNotifier settings database
      mongodump -h localhost --port 27017 -d airnotifier -o /var/airnotifier/
    2. Backup each application data
      mongodump -h localhost --port 27017 -d commoodlemoodlemobile -o /var/airnotifier/;
      mongodump -h localhost --port 27017 -d commoodlemoodlemobiletest -o /var/airnotifier/
  • Pull latest version from git

cd /opt/airnotifier
git pull

  • Check that your current version has a version number in the options collection (AirNotifier settings database) (Older AirNotifier versions doesn't have it), use the shell:
mongo
use airnotifier
db.options.find()
  • If there is not a value option, create a new one:
db.options.insert({name: "version", value: 20140101})
  • Run the upgrade.py script
cd /opt/airnotifier
python upgrade.py
  • Start the server again
./startserver

or

sudo -u airnotifier python airnotifier.py >> /var/airnotifier/console_log 2>> /var/airnotifier/error_log &