Title: Migration, general question
Last modified: August 22, 2016

---

# Migration, general question

 *  Resolved [modus](https://wordpress.org/support/users/modus/)
 * (@modus)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/migration-general-question/)
 * Hi,
 * I’m using another meta-boxes plugin that has been abandoned and am not coder 
   enough to get it to work with newer versions of WP myself. Fortunately it made
   use of the standard postmeta fields for data storage. In my post editors I only
   have text fields, and radio boxes, but the keys do not have a common prefix and
   some boxes are repeatable. So my questions are:
 * – Can I replicate the metaboxes based on my old key/value pairs without using
   a prefix for the keys or is a prefix mandatory?
 * – The old plugin used a numerical id, also stored in postmeta in order to determine,
   which set of meta-boxes had to be used with a post. Is this distinction in CMB2
   based on a certain meta value, too, or does it rely on another method?
 * – When I export the posts via WP, the values for repeatable forms are stored 
   consecutively in the XML, like:
 *     ```
       <wp:postmeta>
       			<wp:meta_key>ext_url</wp:meta_key>
       			<wp:meta_value><![CDATA[http://external.1]]></wp:meta_value>
       		</wp:postmeta>
       		<wp:postmeta>
       			<wp:meta_key>ext_url</wp:meta_key>
       			<wp:meta_value><![CDATA[http://external.2]]></wp:meta_value>
       		</wp:postmeta>
       		<wp:postmeta>
       			<wp:meta_key>ext_link_text</wp:meta_key>
       			<wp:meta_value><![CDATA[text.1]]></wp:meta_value>
       		</wp:postmeta>
       		<wp:postmeta>
       			<wp:meta_key>ext_link_text</wp:meta_key>
       			<wp:meta_value><![CDATA[text.2]]></wp:meta_value>
       		</wp:postmeta>
       ```
   
 * Does this match the way CMB2 stores values, too?
 * Sorry to bug, but could you please enlighten me a bit?
 * [https://wordpress.org/plugins/cmb2/](https://wordpress.org/plugins/cmb2/)

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

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 3 months ago](https://wordpress.org/support/topic/migration-general-question/#post-5728778)
 * “Can I replicate the metaboxes based on my old key/value pairs without using 
   a prefix for the keys or is a prefix mandatory?”
 * The prefix that we have in our examples is not mandatory, it’s just something
   intended to help with organization and grouping. You can use the ID parameters
   for the fields without so that you can match up to what you already have.
 * “The old plugin used a numerical id, also stored in postmeta in order to determine,
   which set of meta-boxes had to be used with a post. Is this distinction in CMB2
   based on a certain meta value, too, or does it rely on another method?”
 * By default, ours would show up on all editors of the specified post type, but
   they can be set to show only on certain ones. However, that setting value is 
   not one that we store in the database or postmeta table. It’s set only in the
   filter callback used for the metabox addition.
 * “Does this match the way CMB2 stores values, too?”
 * Not that I recall, we tend to do more serialized data than multiple values for
   the same key. May not hurt to set up a repeatable field to test with and check
   the resulting value in the database.
 * No bugging done. It’s what we’re here for.
 *  Thread Starter [modus](https://wordpress.org/support/users/modus/)
 * (@modus)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/migration-general-question/#post-5728909)
 * Thanks a lot, I’d have one more question, you said:
 * > It’s set only in the filter callback used for the metabox addition.
 * Looking around in the wiki I found a code snippet that seems to do what I need,
   but just to be sure: can you tell me, if this will still work the same way in
   CMB2?
 *     ```
       'show_on' => array(
       			'key' => 'taxonomy',
       			'value' => array(
       				'category' => 'cat-2',
       				'rotator-location' => …
       			)
       		),
       ```
   
 * (found in [https://gist.github.com/billerickson/070476e584b04a20c770](https://gist.github.com/billerickson/070476e584b04a20c770))
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 3 months ago](https://wordpress.org/support/topic/migration-general-question/#post-5728925)
 * Not sure to be honest, though it wouldn’t take long to test it out either.
 * I know Justin has tried to maintain backwards compatibility where possible, but
   it’s not always going to be the case.
 *  [mac2net](https://wordpress.org/support/users/mac2net/)
 * (@mac2net)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/migration-general-question/#post-5729024)
 * Hi
    Congrats and thanks for the update. As I don’t think I am implementing any
   edgy/outlier cases, should I just follow the [Notable Changes](https://github.com/WebDevStudios/CMB2/wiki/Notable-Changes-in-CMB2)
   guidelines for upgrading?
 * I am also going to retire another plugin but I am confident this won’t be problematic.
 * Thanks
    Mike
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 3 months ago](https://wordpress.org/support/topic/migration-general-question/#post-5729040)
 * That should be fine Mike,
 * I can’t foresee any issues with doing those steps, but let us know if something
   does go wrong so we can investigate.

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

The topic ‘Migration, general question’ is closed to new replies.

 * ![](https://ps.w.org/cmb2/assets/icon.svg?rev=2866672)
 * [CMB2](https://wordpress.org/plugins/cmb2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cmb2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cmb2/)
 * [Active Topics](https://wordpress.org/support/plugin/cmb2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cmb2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cmb2/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/migration-general-question/#post-5729040)
 * Status: resolved