Magic Fields migration

145 views
Skip to first unread message

Zack Lewis

unread,
Apr 27, 2016, 2:04:43 PM4/27/16
to Magic Fields
I am attempting to migrate from an old version of Magic Fields (Version 1.5.8.1) to the newest version. Every time I attempt to migrate, I receive errors (such as http://pastebin.com/LNjV8GZR when I attempt to import) and similar. Is there anything special that I should do? I even tried just updating to the newest Magic Fields v1 plugin, but that threw errors as well and I lost the ability to view a lot of information. I am getting desperate because I need to update these plugins. 

Hunk

unread,
Apr 28, 2016, 1:18:24 AM4/28/16
to Magic Fields
how you try to migrate? MF 1.x can not migrate to 2.x easily. If you want to migrate to 2.x from 1.x you need to create an SQL for migrating ( from write panels to post types, all fields related to the write panel, etc). the versions use a different structure for store the information. you can update version from 1.5.8.1 to 1.6.3.2 with only update files. 

Terry Anglin

unread,
Aug 3, 2016, 3:56:54 PM8/3/16
to Magic Fields
You mentioned creating and SQL for migrating from 1.x to 2.x . Can you provide any documentation of all the changes that would be needed? Is the 2.x version much better than the 1.x ?

Hunk

unread,
Aug 4, 2016, 6:43:45 PM8/4/16
to Magic Fields
Yes, MF2.x is better, MF2.x uses native custom types and custom taxonomies (no fake post type/write panels). the structure of files. MF uses wp_enqueue_script, wp_enqueue_style, add_actions, add_fielter no more harcore code. 

I recommend a backup of your DB before, import the DB backup in another DB (if you can work local better), create a PHP script and migrate step by step. 

Yes, it is a large process, I know. I never had to do a migration, so I do not have much information. but if you check the tables and references in the code I think it will not be so complicated

MF1.x

wp_mf_custom_field_options
this table store the options of fields (Checkbox List, Radiobutton List, Dropdown List, Listbox) also store the default options for this fields

wp_mf_custom_field_properties
store the properties of fields like css,size,width, height, etc

check mf_field_types line 90 in MF_Constant.php for know which field has options and/or properties

wp_mf_module_groups
store the groups of write panels, the coloum at_right is no longer used

wp_mf_panel_category
store the default categories for some write panel (write panel type page)

wp_mf_panel_custom_field
store the custom field (display_name and display_description are no longer used). type is the number of element in mf_field_types

wp_mf_panel_standard_field
this table store the relation field-group

wp_mf_post_meta
this store the fields in a post/page, group_count and field_count are indeces for know the place of field when the group/field is duplicate.
the id value is the same as in wp_postmeta (meta_id)
Note: order_id and group_count are the same value.
Note: in wp_postmeta store the value of field

wp_mf_posttypes_taxonomies
this table is no used

wp_mf_write_panels
store the write panels

Note: in wp_postmeta MF store a row for know which write panel it is, check the coloum meta_key with value mf_write_panel_id, the mate_value is the id of write panel. 





MF2.x
wp_mf_custom_fields
store all fields created, in this table store the opstions/properties of field and the relation with the group.
Note: options is an array serialized

wp_mf_custom_groups
groups of post types

wp_mf_custom_taxonomy
custom taxonomies created, arguments is array serialized with all information, if you want to know all the fields of custom taxonomy check the array $fields in admin/mf_custom_taxonomy.php line 254.

wp_mf_post_meta
as in MF1.x, remember the relation wp_mf_post_meta and wp_post_meta.

wp_mf_posttypes
custom post types created, arguments is array serialized with all information, if you want to know all the fields of custom taxonomy check the array $data in admin/mf_posttype.php line 33.


If you want migrate MF1.x to MF2.x:
- you need read all write panels create post types. remember you need to change the value post_type in mf_post.
- you need migrate all groups
- you need migrate all fields, include the relation between field and group
- migrate relations in postmeta (MF)

Tom McGee

unread,
Jul 22, 2020, 11:59:39 AM7/22/20
to Magic Fields
I recently finished migrating two sites from Magic Fields 1.x to Advanced Custom Fields. It was a major undertaking, with lots of false leads and dead ends, but I finally got it figured out and working. I wrote a series of blog posts on the process (https://tom-mcgee.com/2020/06/from-magic-fields-1x-to-acf-part-1/, maybe there's something there that will be helpful. 

But to make a long story short, you have to re-create your custom fields, then do some scripting to get your old values and insert them in a different way. Some knowledge of PHP/Perl/Bash is vital; and having access to WP-CLI is really helpful. 

One was a stand-alone site, the other was part of a multisite installation. 
Reply all
Reply to author
Forward
0 new messages