Support

Account

Home Forums Backend Issues (wp-admin) Migrating a repeater into a nested repeater using phpMyAdmin

Helping

Migrating a repeater into a nested repeater using phpMyAdmin

  • Hi

    I have a repeater that is present on around 2,000 posts. “Features”

    A recent request from the client is for more than one block of Features

    So I’ve put in a repeater that enables that “Features Blocks” which has nested “Features”.
    But for the historic posts I have left the original repeater.

    So in the Post Edit there are now two fields Features – a repeater with each row a Feature and Feature Blocks – a repeater with each row a set of Features – in turn a repeater with each row a Feature)

    This is not very elegant and has the power to confuse (never too difficult with the average client)

    What I would like to do (via phpMyAdmin) is to migrate the rows of the original repeater into the repeater contained in the first row of the new repeater.

    Any pointers as to how I can do this?

    Many thanks, Chris

    PS I’ll also post this on the community forum.

  • I’d use the “update” from my sql on the wp-postmeta to change the meta_value of the fields, to the new field key. Make a backup before 🙂

    Update wp_postmeta set meta_value = 'new field key' where meta_value='old field key' and substr(meta_key,1,1) = '_'

    Note that the meta value has to be in the form field_llnmc9c86353a

    The second condition is just to check where are dealing with the right meta

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.