Changes between Version 16 and Version 17 of UserGuidelines/Admin/DataMigration/Haiti


Ignore:
Timestamp:
01/20/10 19:54:42 (15 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UserGuidelines/Admin/DataMigration/Haiti

    v16 v17  
    11[wiki:Haiti]
    22----
    3 == Data Migration ==
     3== Data Migration & Consistency ==
    44
    55We want to be able to migrate data from Prod to Dev so that Testers / Documenters have real data to play with.
    66
    7 Easy!:
     7Easy as a 1-off:
    88{{{
    99/etc/init.d/apache2 stop
     
    1313}}}
    1414
     15Maintaining this should be possible via [wiki: DataMigration#WebServices Web Services]
    1516
    1617Also want to be able to migrate from the current sqlite backend to [wiki:InstallationGuidelinesMySQL MySQL]
     18
     19We often need to use this same tricks to deal with database consistency issues.
    1720
    1821=== CSV ===
    1922Beware DB locks!
    2023 * Don't keep Web2Py shell open longer than necessary
     24 * Consider goign into Maintenance Mode on the Webserver & disabling the Web2Py cron in {{{/etc/crontab}}}
    2125
    2226{{{
    23 python web2py.py -S prod -M
     27python web2py.py -S prod -M -N
    2428db.export_to_csv_file(open('db.csv','wb'))
    2529Ctrl+D
     
    3034NB Do CSV file edits in a text editor, not MS Excel (MS Excel makes the dumps unusable!)
    3135
     36NB Be careful of file permissions!
     37 * All files in the databases folder should be {{{chown www-data:www-data}}}
     38 * If the 1st run of the model happens in the Python shell, then they will be owned by root...
     39
    3240{{{
    33 python web2py.py -S dev -M
     41python web2py.py -S dev -M -N
    3442db.import_from_csv_file(open('db.csv','rb'))
    3543db.commit()
     
    115123    *  http://localhost:8000/sahana/gis/location/create?format=xml&fetchurl=http://haiti.sahanafoundation.org/prod/gis/location.xml
    116124    *  http://localhost:8000/sahana/pr/person/create?format=xml&fetchurl=http://haiti.sahanafoundation.org/prod/pr/person.xml
    117     *  http://localhost:8000/sahana/or/organisation/create?format=xml&fetchurl=http://haiti.sahanafoundation.org/prod/or/organisation.xml?components=office
    118     *  http://localhost:8000/sahana/or/office/create?format=xml&fetchurl=http://haiti.sahanafoundation.org/prod/or/office.xml
     125    *  http://localhost:8000/sahana/or/organisation/create?format=xml&fetchurl=http://haiti.sahanafoundation.org/prod/or/organisation.xml
     126     * This should pull in all components, so no need to do:
     127     *  http://localhost:8000/sahana/or/office/create?format=xml&fetchurl=http://haiti.sahanafoundation.org/prod/or/office.xml
    119128    *  http://localhost:8000/sahana/or/contact/create?format=xml&fetchurl=http://haiti.sahanafoundation.org/prod/or/contact.xml
    120129 * BluePrintSynchronisation