.. _def-plateform_migration: =================== 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 #. For commons -> Main: renaming tables and relation into SQL dump before importing it; * Rename its contenttype name also! #. Add missing models and fields from Culturdiag; * Culturdiag #. Just add missing models and fields from Inserdiag; So for data migration, workflow will be: #. Do schema migration into Inserdiag to create missing models and fields from Culturdiag; #. Dump Inserdiag BDD; #. Rename some things into the dump; #. Import it; #. 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. #. Your install should be on master branch; #. Backup your datas and medias elsewhere; #. Pull the ``support_autodiag_2-0`` branch and switch to it; #. Launch buildout on your environment; #. Apply migrations; #. It's done; Inserdiag concrete procedure ---------------------------- #. Your install should be on master branch, else there is a problem; #. Backup your datas and medias elsewhere; #. Pull the inserdiag migration branch named ``move_to_autodiag_2-0`` and switch to it; #. Execute ``django-instance syncdb``; #. Execute ``django-instance migrate``; #. Dump your current inserdiag database; #. Drop all tables from your current inserdiag database; #. Use ``make clean`` command; #. Execute ``buildout -c production.cfg`` (or any other ``*.cfg`` file depending your environment); #. Pull the branch named ``autodiag_ready`` and switch to it, this will migrate repository to the required Autodiag structure; #. Use ``make install`` command; #. Use script ``bin/preprocess_sql_migration`` on inserdiag dump file that will modify it into a ``*.migrated.sql`` file; #. Import the previously created file ``*.migrated.sql`` into your (previously emptied) inserdiag database; #. Execute ``eggedpy postprocess_sql_migration`` to post-process the database; #. Execute ``django-instance syncdb``; #. Execute ``django-instance migrate``; #. ???? #. 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.