Plateform migration

Here will be the procedure to migrate Inserdiag database to the a structure compatible for Autodiag.

Warning

Take care to save all datas and media files before doing anything from this document.

Plan

  • Inserdiag
    1. For commons -> Main: renaming tables and relation into SQL dump before importing it;
      • Rename its contenttype name also!
    2. Add missing models and fields from Culturdiag;
  • Culturdiag
    1. Just add missing models and fields from Inserdiag;

So for data migration, workflow will be:

  1. Do schema migration into Inserdiag to create missing models and fields from Culturdiag;
  2. Dump Inserdiag BDD;
  3. Rename some things into the dump;
  4. Import it;
  5. Fake south migrate to init migration history;

Culturdiag concrete procedure

Culturdiag is allready working on Autodiag, the migration should just be about minor data migrations to follow some Models adding made for Inserdiag features merging in Autodiag.

  1. Your install should be on master branch;
  2. Backup your datas and medias elsewhere;
  3. Pull the support_autodiag_2-0 branch and switch to it;
  4. Launch buildout on your environment;
  5. Apply migrations;
  6. It’s done;

Inserdiag concrete procedure

  1. Your install should be on master branch, else there is a problem;
  2. Backup your datas and medias elsewhere;
  3. Pull the inserdiag migration branch named move_to_autodiag_2-0 and switch to it;
  4. Execute django-instance syncdb;
  5. Execute django-instance migrate;
  6. Dump your current inserdiag database;
  7. Drop all tables from your current inserdiag database;
  8. Use make clean command;
  9. Execute buildout -c production.cfg (or any other *.cfg file depending your environment);
  10. Pull the branch named autodiag_ready and switch to it, this will migrate repository to the required Autodiag structure;
  11. Use make install command;
  12. Use script bin/preprocess_sql_migration on inserdiag dump file that will modify it into a *.migrated.sql file;
  13. Import the previously created file *.migrated.sql into your (previously emptied) inserdiag database;
  14. Execute eggedpy postprocess_sql_migration to post-process the database;
  15. Execute django-instance syncdb;
  16. Execute django-instance migrate;
  17. Execute django-instance migrate --fake --delete-ghost-migrations --merge;

Future

When all plateform will be Autodiag 2.x ready on production, the plateform branches for supporting Autodiag 2.x will be merged to master.