0 votes

Hello Everybody,

If you have project developed in Doctrine, Doctrine2, Propel or CakePHP, and need to transfer it to different framework ORM Designer can help you, but it cannot do it completely automatically. Let me explain how to do this and why:

It is not a problem for ORM Designer to export to one framework the schema definitions imported from another. The output format of the data is handled easily. Problem is with the ORM properties. Each ORM framework uses different set of functions which is covered by various properties. And even the similar function can have different names. These sets can even differ across various versions. The conversion matrix that would properly deal with all the different properties and their syntax across the frameworks is impossible to create.

This means you can transfer your model, all your entities and relations together with the core attributes (names, ids, fields etc.) to different framework, and then you will need to check all entities and fix the ORM properties. Please proceed as follows:

  1. Import your project in the ORM designer
  2. Save the project
  3. Locate the project file (*.ormdesigner2)
  4. Remove all ORM specific properties (defined by ) from the project file
  5. Change the definition of the ORM framework in the project file header. Keywords for the frameworks are propel, doctrine, doctrine2 and cakePHP. For example:
    Change this

    to
  6. Open the edited project in the ORM Designer
  7. Check all your entities. All ORM properties of the new ORM framework will be automatically generated but will have no values set. If you used some of these properties, you will have to define them manually again.

Note: There is a dirty variant of this method. You can skip removing the ORM specific properties. Then the properties that use same name in both frameworks will be merged. However the properties that have different names, will not be merged and will be unrecognized or may even cause some error. In this case you will have to look for the incompatible properties selectively and remove them.

in How To & Manuals by Skipper developer (74.8k points)
recategorized by

Please log in or register to answer this question.