Migrating from old system

Enonic version: 6.9.0
OS: Linux

Hi !

We are trying to migrate from old system ( 5.3.0 ) to new ( 6.9.0 ). I have exported all old articles and created a script ( php ) to “transform” XMLs into new format. And I’m having a few problems:

  1. By default it doesn’t work and there is no any error message in logs ( I’m using DataToolbox app ).
  2. It doesn’t work with HTML code inside “text” component ( in region ). If I put simple word text - it almost works ( check point 3 ).
  3. It doesn’t work with old ID, but if I change one symbol in content ID - new object will be created.

So my question is - is there any restrictions for content with IDs ? I need to keep IDs, to have a relation between objects/images etc.
How can I “debug” import process ?

Files that are changed by my script looks fine.

Thank you !

Why are you not using the upgrade scripts shipped with the various versions in between?

Hi Thomas,

I can’t use migration scripts because old and new installation are completely different. New content types, templates, controllers. So my goal is to adapt XML file with old data to new content type.

I see, so it’s not just an upgrade, but a rewrite at the same time?

Essentially, you need to produce import xml that is valid towards the content domain of xp 6.9. The import you are using is not aware of “content domain” as you are importing on a lower level (repository), so you won’t get any warnings with this approach. This can be compared like by-passing the application logic and writing straight to SQL, you need to be 100% sure your data are valid. If you use the content API however you would - but it does not handle xml…

Using old ID’s should work fine.

I recommend you

  1. run all the upgrade scripts on exported data
  2. then re-process this with your php script.

This approach will at least provide you with a valid baseline dataset for 6.9.

Upgrading and rewriting at the same time is never the “easy way” to do things :sweat:

Thank you for reply :slight_smile:

Since everything works with “dummy” data I assume that my upgrade/rewrite script works. So the main question how can I debug import process ?
And also - can I use CDATA inside XML file ? Maybe this will help me to handle HTML code.

Thanks !

I was able to get error during import. And it’s very strange.

“Could not import node in folder [/enonic-xp/home/data/export/export_upd/archive/article]: Node already exist, id: b40b5e97-1fa4-458e-8de6-332b4c91a77c - com.enonic.xp.node.NodeIdExistsException: Node already exist, id: b40b5e97-1fa4-458e-8de6-332b4c91a77c”.

However I can’t find any object with this ID -

Maybe this is a bug in import ?

After some investigations and updates I was able to make it work :slight_smile: Only two small issues/bugs left:

1 - object from previous post. I can’t remove it and it’s not visible. Also I can’t update it. How can I remove this object ?
2 - Image objects that are located under article object. They are imported and visible in article, but objects are not visible in content tree.

Do you have any thoughts regarding second point ?

Update - I was able to make images work :slight_smile:

So there is only one point left - remove “hidden” objects.

1 Like