= Upgrades = [[TOC]] == Fabfile == This is normally done using Fab: {{{ fab deploy }}} * Current Fabfile: http://eden.sahanafoundation.org/browser/static/scripts/tools/fabfile.py * Current Aliases: ConfigurationGuidelines#Usefulaliases See: * PakistanDeploymentCycle == Old == Put site into Maintenance: {{{ vim /etc/crontab #0-59/1 * * * * www-data cd /path/to/web2py/ && python web2py.py -C -D 1 >> /tmp/cron.output 2>&1 vim /etc/apache/sites-available/maintenance RewriteEngine On RewriteRule ^/(.*) /maintenance.html ln -sf /etc/apache/sites-available/maintenance /etc/apache/sites-enabled/mysite /etc/init.d/apache2 force-reload }}} Upgrade code: {{{ cd /path/to/web2py/applications/eden bzr pull }}} Trial run: {{{ cd /path/to/web2py python web2py.py -S eden -M }}} Fix any Database Issues: 1. The .table files in the databases directory contains what web2py knows about your database 2. You need to set deployment_settings.base.migrate=True in {{{models/000_config.py}}} before you update the code and switch back to deployment_settings.base.migrate=False later on. 3. In case of database mismatches - check the databases directory for the appropriate {{{.table}}} file and change accordingly. If using [wiki:InstallationGuidelinesMySQL MySQL], then can use [http://phpmyadmin.net phpMyAdmin], if using SQLite then can use {{{sqlite3}}} command-line tool: * Linux: ({{{apt-get install sqlite3}}}) * Windows: http://www.sqlite.org/sqlite-3_6_23_1.zip * Documentation: http://www.sqlite.org/sqlite.html Restore site into production: {{{ vim /etc/crontab 0-59/1 * * * * www-data cd /path/to/web2py/ && python web2py.py -C -D 1 >> /tmp/cron.output 2>&1 ln -sf /etc/apache/sites-available/mysite /etc/apache/sites-enabled/mysite /etc/init.d/apache2 force-reload }}} * MaintenanceGuidelines * UserGuidelines/Admin/DataMigration ---- BluePrintUpgrades UserGuidelines/Admin