Changes between Version 18 and Version 19 of UserGuidelines/Admin/DataMigration/Haiti


Ignore:
Timestamp:
01/20/10 21:55:09 (12 years ago)
Author:
Fran Boon
Comment:

--

Legend:

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

    v18 v19  
    117117./maintenance.off
    118118}}}
     119==== Dealing with database corruption ====
     120We had problems with the or_organisation table - queries wouldn't complete.
     121
     122The tracebacks included: {{{ValueError: invalid literal for int() with base 10: '01/14/10 1'}}}
     123To fix this we needed to:
     124 * Delete column from model
     125{{{
     126vim /home/haiti/prod/models/05_or.py
     127
     128resource = 'organisation'
     129table = module + '_' + resource
     130db.define_table(table, timestamp, deletion_status,
     131  # uuidstamp
     132}}}
     133 * Export as CSV
     134{{{
     135cd /home/haiti/web2py
     136python web2py.py -S prod -M -N
     137db.or_organisation.export_to_csv_file(open('prod_orgs.csv','wb'))
     138Ctrl+D
     139}}}
     140 * Drop table
     141{{{
     142cd /home/haiti/web2py
     143python web2py.py -S prod -M -N
     144db.or_organisation.drop()
     145db.commit()
     146Ctrl+D
     147}}}
     148 * Rebuild Table
     149  * Ensuring that table is owned by www-data
     150   * http://haiti.sahanafoundation.org
     151 * Reimport from CSV
     152{{{
     153cd /home/haiti/web2py
     154python web2py.py -S prod -M -N
     155db.or_organisation.import_from_csv_file(open('prod_orgs.csv','rb'))
     156db.commit()
     157Ctrl+D
     158}}}
    119159=== Web Services ===
    120160Better to avoid locks & do without SSH login