Support

Account

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

  • There isn’t any way that I’d attempt to move values on 2000 posts given my previous comment.

    The best way to do this is to use the load_value hook on the new repeater. In your filter see if the the repeater has a value and remove the values in the old repeater using the same hook on that repeater.

    Caution: Do actually update the database/fields. This way the changes are only made if the client actually save the post.

    In the admin, hide the old repeater field, but leave it in place. The best way to do this is probably adding some custom CSS, but there might be other ways.

    In your template create two possible code blocks, one to show the new repeater and the second to show the old repeater when the new repeater has no values.

    This makes it possible to slowly convert the old to the new as the client updates the posts instead of retroactively updating every post.

    There is a lot of details missing in the above explanation and you’ll need to do some searching to find it. All of it can be found on this forum, likely by me. You will need to understand how to generate values for a nested repeater using the load_value hook. This has been discussed many times here.