Home › Forums › Backend Issues (wp-admin) › Restore data relationships with only MySQL backup?
We experienced trouble on a server migration from one dev server to another and lost the ability to access WP and export a JSON file from the ACF PRO plugin. I have a database exported (MySQL) and can see the data in the wp_postmeta table but when I pointed WP to the new database, most of the field groups are gone- like the data can’t map properly without the JSON file to import.
I have written support and they say I can map the data from the wp_postmeta table to the matching post IDs, but I’m unsure how to do this/ where to start? I apologize if this issue has been covered somewhere, but I’ve been searching and haven’t found this specific issue.
Thanks for your help! Great plugin btw 🙂
Did you try to recreate the field groups for the existing data? If this is the case then the problem is that the field keys are all incorrect and this would lead to what you describe (data in the database that does not appear in the fields)
When migrating from one database to another I generally just export all of the tables in the database and then import all of those tables and data into a fresh database. This preserves everything.
There is no easy way to fix this, it would be quite laborious. You would need to find each occurrence of each of the old field key values and replace them with the new field keys.
@hube2 – thanks for the quick response! I will check through this all and see what I can do :).
One thing I did notice is that all of the top level field groups came over as expected, along with all associated data. But one of the field groups has nested flexible content pieces that uses the layouts as selectable modules/page sections. That looks like the main area where the databse relationship gets jackedUp. Looking in MySQL Workbench I can see the data is there, it just does not import and hook up the way the other fields do. Any thought?
Thanks again for your help!
Most of the basic field types and some of the others will work as expected it you need to rebuild a field group.
The problems come in for more complicated fields.
For every field acf stores two values in the database, for example lets say is a simple field.
The first entry in the database is your field name with its value
meta_key => field_name
meta_value => your value
the second entry is the field key reference
meta_key => _field_name
meta_value => acf field key example: field_1234567890
for many fields, acf doesn’t know what to do with the value unless it can find the field key reference and this is why the more complicated fields end up blank.
The topic ‘Restore data relationships with only MySQL backup?’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.