Changes between Version 16 and Version 17 of UserGuidelines/Admin/DataMigration/Haiti
- Timestamp:
- 01/20/10 19:54:42 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UserGuidelines/Admin/DataMigration/Haiti
v16 v17 1 1 [wiki:Haiti] 2 2 ---- 3 == Data Migration ==3 == Data Migration & Consistency == 4 4 5 5 We want to be able to migrate data from Prod to Dev so that Testers / Documenters have real data to play with. 6 6 7 Easy !:7 Easy as a 1-off: 8 8 {{{ 9 9 /etc/init.d/apache2 stop … … 13 13 }}} 14 14 15 Maintaining this should be possible via [wiki: DataMigration#WebServices Web Services] 15 16 16 17 Also want to be able to migrate from the current sqlite backend to [wiki:InstallationGuidelinesMySQL MySQL] 18 19 We often need to use this same tricks to deal with database consistency issues. 17 20 18 21 === CSV === 19 22 Beware DB locks! 20 23 * 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}}} 21 25 22 26 {{{ 23 python web2py.py -S prod -M 27 python web2py.py -S prod -M -N 24 28 db.export_to_csv_file(open('db.csv','wb')) 25 29 Ctrl+D … … 30 34 NB Do CSV file edits in a text editor, not MS Excel (MS Excel makes the dumps unusable!) 31 35 36 NB 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 32 40 {{{ 33 python web2py.py -S dev -M 41 python web2py.py -S dev -M -N 34 42 db.import_from_csv_file(open('db.csv','rb')) 35 43 db.commit() … … 115 123 * http://localhost:8000/sahana/gis/location/create?format=xml&fetchurl=http://haiti.sahanafoundation.org/prod/gis/location.xml 116 124 * 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 119 128 * http://localhost:8000/sahana/or/contact/create?format=xml&fetchurl=http://haiti.sahanafoundation.org/prod/or/contact.xml 120 129 * BluePrintSynchronisation