Note:

This site is no longer used and is in read-only mode. Instead please go to our new Moodle Developer Resource site.

Upgrading Airnotifier: Difference between revisions

From MoodleDocs
m Text replacement - "<code>" to "<syntaxhighlight lang="php">"
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:WillNotMigrate}}
{{Warning|This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.}}
Steps to upgrade
Steps to upgrade


Line 5: Line 8:
  ps aux | grep airnotifier
  ps aux | grep airnotifier
  kill -9 PROCESS_ID
  kill -9 PROCESS_ID
</code>
</syntaxhighlight>


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


* Pull latest version from git
* Pull latest version from git
Line 15: Line 18:
  cd /opt/airnotifier
  cd /opt/airnotifier
  git pull
  git pull
</code>
</syntaxhighlight>


* 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:
* 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:
Line 34: Line 37:
  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]] [[Category: Obsolete]]

Latest revision as of 07:12, 29 April 2022


Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.


Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.


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 &