0

Grown with the years, one of my projects consists of several Channels with several Field Groups and dozens of custom fields. Now with ExpressionEngine 4 and the new fluid field we want to consolidate most of the custom fields so we're not longer depending on so many custom fields … whats the easiest and safest way to migrate from «multiple custom fields to one fluid field»?

For example – right now we have Channel1, Channel2, Channel3 etc. each with field groups with custom fields like channel1-bodytext, channel2-bodytext, channel3-bodytext and of course many, many more.

How can I migrate/export/import those into just one text-field inside one fluid field used by all channels?

2

I am not aware of any add-on that will do this kind of transformation, but if you are comfortable working on your EE4 database directly using SQL it is certainly possible to do that way.

I had to do this recently sorting out an EE2 site being migrated to EE4. For that work I was pulling entries from channels and writing them to fluid fields (including grid fields). Worked OK. Didn't try and migrate relationship fields - but imagine that they are doable too.

A detailed description of what to do is beyond scope of this kind of space, but simplistically:

  • Use EE to create the fluid fields you need
  • Put one unique fake entry information in each field
  • Use something like Sequel Pro to find the definition information for each field created (e.g. the channel field / grid number, and the position of the field in the fluid field register)
  • For each field, generate a list of the entry_id's of the entries that you want to migrate and that have a value in the field
  • Construct a custom SQL query to copy the content of the migrating fields to the new fluid field entry - you will need to make sure you increment some counters in the fluid field register to do this correctly
  • (side note - I wrote a set of EE templates to automatically generate the required SQL queries - saved a lot of time)
  • test / delete the old fields.

This is a non-trivial activity for you by sound of it, but once you get hang of how it works it should be manageable.

Usual words of caution - back everything up, and do this work on a development server... it is easy to break things.

Of course if you want someone else to do it for you... drop me a line via my website :)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.