| | 69 | ==== Changing a set of Lookup Options live ==== |
| | 70 | We can eaisly amend the module_resource_opts = {} live in the code (usually models/module.py) however we need to migrate existing data (after backing it up, of course): |
| | 71 | {{{ |
| | 72 | cd /home/haiti/prod |
| | 73 | bzr pull |
| | 74 | |
| | 75 | cd /home/haiti/web2py |
| | 76 | python web2py.py -S prod -M |
| | 77 | |
| | 78 | db(db.or_organisation.id > 0).select().export_to_csv_file(open('orgs.csv','wb')) |
| | 79 | db(db.or_organisation.type == 4).update(type='') |
| | 80 | db(db.or_organisation.type == 5).update(type='') |
| | 81 | db.commit() |
| | 82 | Ctrl+D |
| | 83 | |
| | 84 | /etc/init.d/apache2 force-reload |
| | 85 | }}} |
| | 86 | |
| | 87 | If the system is being heavily used, need to put up a holding page during this time to prevent data entry. |
| | 88 | For switching on maintenance. |
| | 89 | {{{ |
| | 90 | cd /home/haiti |
| | 91 | ./maintenance.on |
| | 92 | }}} |
| | 93 | For switching off maintenance. |
| | 94 | {{{ |
| | 95 | cd /home/haiti |
| | 96 | ./maintenance.off |
| | 97 | }}} |