Custom Fields
Re-Envisioned
Support Meta Box Builder Migrating custom fields data between Custom Post Types and Taxonomies

This topic contains 3 replies, has 2 voices, and was last updated by  Anh Tran 1 year, 2 months ago.

  • Creator
    Topic
  • #9896
    Resolved
    Mauro
    Participant

    I want to migrate my data from Alchemy and CMB2 to MetaBox.io.
    Is there any boilerplate script or some plug-in to migrate fields and CPT data from these to the ones I am setting up using MB?

    So far, I am thinking to use the REST API to get a flat object data and then build a parser to populate the fields accordingly. But I believe there must be some plug-in that allows to map existing data to the fields I’m creating in MB.

    Can you give me pointers?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #9935

    Anh Tran
    Keymaster

    Hi Mauro,

    If your fields are just simple fields, you don’t need to migrate at all. Meta Box, CMB2 and Alchemy use the same way to store value. So, all you need to do is creating same fields in Meta Box, make sure their IDs match the meta key in CMB2 / Alchemy.

    That even works for repeater in CMB2. I haven’t tried with all field types of CMB2, but so far it works for me pretty well. So please just try to create same fields in MB first. If something goes wrong, then you should write a small PHP script to:

    That’s it.

    #10028

    Mauro
    Participant

    Hi Anh, so I’m trying to replicate my data structure from Alchemy over to MetaBox.io and I think I managed to have the same serialised array. Now I have this problem: my custom code allowed to select another post type to relate content, and I used the slug to identify the post rather then the ID.

    I did this because this way if the post was accidentally deleted it could be re-created and as long as the same slug was kept, the relation would still be in place.

    I assume you use IDs in the ‘post’ custom field select rather then slugs. Correct?
    So in the end, I’m afraid I’ll have to write that migration script, unless you can come up with some brilliant solution that I don’t see. 🙁

    #10039

    Anh Tran
    Keymaster

    Hi,

    I’m quite confused about the slug. WordPress doesn’t use it to store custom fields for posts. WordPress use a combination of (post ID, meta key, meta value) in the DB. That’s the post ID that Meta Box is using.

    Anyway, if there’s anything involved with “slug”, then it’s not supported by Meta Box :(. So a custom migration script is required, I guess.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.