234 | | 2) Use of the INNODB engine for the db can lead to Integrity Errors during the first run and import -> Recommend MyISAM for now. |
| 234 | 2) SQLite doesn't support FOREIGN KEY constraints, neither does MySQL with MyISAM tables. |
| 235 | |
| 236 | |
| 237 | === Migration plan === |
| 238 | |
| 239 | 1) Put the site in read only mode -> Disable Login, Kill existing sessions[[BR]] |
| 240 | 2) Export the CSV from web2py shell[[BR]] |
| 241 | 3) Create a MyISAM database(say name = sahana) in mysql[[BR]] |
| 242 | 4) Disable zzz_1st_run.py and zzz_last.py[[BR]] |
| 243 | 5) Switch the settings in 00_db.py to mysql and do a [[BR]] |
| 244 | |
| 245 | {{{ |
| 246 | python web2py.py -S sahana -M -N |
| 247 | db.commit() |
| 248 | CTRL+Z |
| 249 | }}} |
| 250 | |
| 251 | |
| 252 | 6) Drop the tweets and sms data and their corresponding GIS [ Check for any pledges ][[BR]] |
| 253 | |
| 254 | 7) Split the data into the 5 csv's as follows(say db1.csv, db2.csv,..) - Deleting other tables.[[BR]] |
| 255 | |
| 256 | {{{ |
| 257 | TABLE auth_event |
| 258 | TABLE admin_theme |
| 259 | TABLE s3_audit |
| 260 | TABLE s3_setting |
| 261 | TABLE s3_source |
| 262 | TABLE appadmin_setting |
| 263 | =========================== |
| 264 | TABLE pr_setting |
| 265 | TABLE pr_pentity |
| 266 | TABLE pr_person |
| 267 | TABLE pr_group |
| 268 | =========================== |
| 269 | TABLE gis_setting |
| 270 | TABLE gis_marker |
| 271 | TABLE gis_projection |
| 272 | TABLE gis_symbology |
| 273 | TABLE gis_config |
| 274 | TABLE gis_feature_class |
| 275 | TABLE gis_symbology_to_feature_class |
| 276 | TABLE gis_location |
| 277 | TABLE gis_feature_group |
| 278 | TABLE gis_location_to_feature_group |
| 279 | TABLE gis_feature_class_to_feature_group |
| 280 | TABLE gis_apikey |
| 281 | TABLE gis_track |
| 282 | TABLE gis_layer_openstreetmap |
| 283 | TABLE gis_layer_google |
| 284 | TABLE gis_layer_yahoo |
| 285 | TABLE gis_layer_gpx |
| 286 | TABLE gis_layer_georss |
| 287 | TABLE gis_layer_kml |
| 288 | TABLE gis_layer_wms |
| 289 | TABLE gis_layer_tms |
| 290 | TABLE gis_layer_xyz |
| 291 | TABLE gis_layer_js |
| 292 | ============================ |
| 293 | TABLE pr_contact |
| 294 | TABLE or_setting |
| 295 | TABLE or_sector |
| 296 | TABLE or_organisation |
| 297 | TABLE or_office |
| 298 | TABLE or_contact |
| 299 | TABLE or_project |
| 300 | TABLE or_activity |
| 301 | TABLE lms_setting |
| 302 | TABLE lms_catalog |
| 303 | TABLE rms_setting |
| 304 | TABLE admin_setting |
| 305 | TABLE budget_setting |
| 306 | TABLE cr_setting |
| 307 | TABLE dvi_setting |
| 308 | TABLE dvr_setting |
| 309 | TABLE hrm_setting |
| 310 | TABLE mobile_setting |
| 311 | TABLE mpr_setting |
| 312 | TABLE msg_setting |
| 313 | TABLE sync_setting |
| 314 | TABLE vol_setting |
| 315 | |
| 316 | }}} |
| 317 | |
| 318 | 8) Remove duplicates in the auth_user ( only Linda* when I checked) and pr_person[[BR]] |
| 319 | |
| 320 | 9) Clean up gis_layer_js -> make multi lined records single lined[[BR]] |
| 321 | |
| 322 | 10) In or_organisation -> remove "Medecins du Monde France" entry as "Médecins du Monde France" is treated as the same in MySQL[[BR]] |
| 323 | |
| 324 | 11) Clean up multi lined records in or_organisation.[[BR]] |
| 325 | |
| 326 | 12) Test import - multilined entries give a "raise SyntaxError, 'invalid file format' [[BR]] |
| 327 | |
| 328 | 13) or_sector does not have entries 14,15,16 - which are in the database associated with some organisations - Fix them[[BR]] |
| 329 | |
| 330 | 14) Check that the site is completely functional.[[BR]] |
| 331 | |
| 332 | 15) Go to phpmyadmin and export the entire db as sql.[[BR]] |
| 333 | |
| 334 | 16) Replace all MyISAM lines in the sql with INNODB[[BR]] |
| 335 | |
| 336 | 17) Drop the datbase using phpmyadmin and import the previously created sql[[BR]] |
| 337 | |
| 338 | 18) Test everything once.[[BR]] |
| 339 | |
| 340 | 19) Switch this to production[[BR]] |
| 341 | |
| 342 | Estimated time for migration: 1 hour |