--- /dev/null
+=========================================
+CREM database: 4D to MySQL raw conversion
+=========================================
+
+Instructions and scripts to perform a full raw conversion of the CREM
+database from 4D to MySQL. The result has the same structure as the
+original 4D database, and, as such, can't be used directly in
+Telemeta.
+
+Exporting the 4D database to text files
+---------------------------------------
+
+These instructions are for 4D 6.5.x on Windows. It should be possible to do this on
+the Mac version too, with a few modifications. Warning: do this on a copy of the 4D
+database, not on the production one.
+
+1. Export all tables (all fields, all records) to windows "Text"
+ files, **with column titles**, using the 4D export dialogs. The resulting
+ files must named as the table with .txt as extension (ex: ``Support.txt``)
+
+2. Create a new 4D method using the code provided in ``export_formations_4d.txt``
+ and run it in order to export many-to-many instruments/performances relations
+ to ``C:\Formation.txt``
+
+ Side note: if you're using a demo version of 4D you can't create a new method.
+ Just replace an existing method in this case.
+
+3. Create a new 4D method using the code provided in
+ ``export_fonction_usage_4d.txt`` and run it in order to export many-to-many
+ keywords relations to ``C:\Fonction_Usage.txt``
+
+
+
+
--- /dev/null
+
+$doc:=Creer document("c:\Fonction_Usage.txt";"TXT")
+Si (ok=1)
+ $tab:=Caractere(9)
+ $fin:=Caractere(13)
+ TOUT SELECTIONNER([Phono])
+ Boucle ($i;1;Enregistrements trouves([Phono]))
+ $cote:=[Phono]Cote_Phono
+ TOUS LES SOUS ENREGISTREMENTS([Phono]Fonction_Usage)
+ Boucle ($j;1;Sous enregistrements trouves([Phono]Fonction_Usage)
+ $texte:=$cote+$tab+[Phono]Fonction_Usage'Mot_Clef+$fin
+ ENVOYER PAQUET($doc;Mac vers Windows($texte))
+ SOUS ENREGISTREMENT SUIVANT([Phono]Fonction_Usage)
+ Fin de boucle
+ LIBERER ENREGISTREMENT([Phono])
+ ENREGISTREMENT SUIVANT([Phono])
+ Fin de boucle
+
+ FERMER DOCUMENT($doc)
+
+Fin de si
+
--- /dev/null
+
+$doc:=Creer document("c:\Formation.txt";"TXT")
+Si (ok=1)
+ $tab:=Caractere(9)
+ $fin:=Caractere(13)
+ TOUT SELECTIONNER([Phono])
+ Boucle ($i;1;Enregistrements trouves([Phono]))
+ $cote:=[Phono]Cote_Phono
+ TOUS LES SOUS ENREGISTREMENTS([Phono]Formation)
+ Boucle ($j;1;Sous enregistrements trouves([Phono]Formation)
+ $texte:=$cote+$tab+[Phono]Formation'Instr_Scientif+$tab+[Phono]Formation'Instr_Vernacul+$tab+[Phono]Formation'Interpr?te+$tab+[Phono]Formation'Total_Instrum+$fin
+ ENVOYER PAQUET($doc;Mac vers Windows($texte))
+ SOUS ENREGISTREMENT SUIVANT([Phono]Formation)
+ Fin de boucle
+ LIBERER ENREGISTREMENT([Phono])
+ ENREGISTREMENT SUIVANT([Phono])
+ Fin de boucle
+
+ FERMER DOCUMENT($doc)
+
+Fin de si
+