I’ve created a rather elaborate set of fields using ACF (easily 50+) that allow my client to customize theme and plugin configurations. They’d like a way to be able to export the settings that they’ve applied on one particular installation and import them over to a new.
How do you suggest I do that?
To be clear, this isn’t about importing / exporting the *fields*, which I can easily do, but rather the values within the fields.
All of the field values in question here are setup using the Options add-on.
Pardon me if the answer is obvious – it’s way past my bedtime :).
Hi Elliot – Thanks for the follow-up. Are the “Options” values stored in the wp_postmeta table as well? In this particular case I am wanting to target only the field values that have been saved to a series of settings screens setup using the “Options Page” Add-on.
Elliot – I’m circling back to this as I’m facing the issue again. What I’m trying to accomplish is an export of all of the values that have been set via the “Options” add-on.
Is this something that will be handled, perhaps, in ACF 5?
The use-case is a site with easily 100+ values set via admin options pages. The client would like the ability to export and import all of the site settings (set via ACF) from one installation to another.
I’ve just done this by exporting directly from the wp_postmeta table. In my case, they were for a specific post, so I exported
meta_value from wp_postmeta where the post_id was the post I wanted. I then changed the post_id in the export to be the post_id in my other site, and then inserted the values into the other database. Note, I specifically didn’t export
meta_id as this is an auto-increment field.
Thanks for the follow-up Douglas.
In my case, the issue I’m running into is the high volume of settings and the fact that most of the values are associated with an “Options” page, versus a post.
The *ideal* would be a way to “export” all values associated with “Options” pages and then “import” them into another installation.
Just wanted to follow-up on this again.
In the case of a particular project a bulk of the values are being stored as “Options” and, accordingly, wouldn’t come over by default (unless I’m missing something) with an import/expert of post content.
Any ideas on how I might give users the ability to “Export” their saved options and “Import” them into another installation with the same fields?
The use-case here, particularly in the case of ACF Pro, is a plugin/theme combination that’s being “cloned” (and customized) to another installation.. Using the JSON files they’ll automatically have the same *field groups* but they would all be empty. We’re dealing with 100+ settings so I’d like them to be able to import and pre-populate them from the previous installation.
Try this plugin https://wordpress.org/plugins/all-in-one-wp-migration/ for export ACF values..
I got this solution from https://www.slicemytheme.com, when I purchased a theme from them.
Hey guys. I have this same issue. @sirjonathan Did you figure out a good solution for this? I also want to import values into the options area.
I am just wondering if anyone found a good way to do this. Currently, I am using WP All Import to get the content related to the pages and CPTs but I can’t seem to find a way to target the Options area values.
Not sure how I got on this old thread, but it seems like the basic followup question was not ever explicitly answered here:
As Elliot points out “ACF saves it’s values in the native wp_postmeta table” for fields that are attached to a post.
Likewise, ACF leverages the core wordpress functions and tables for storing options – so they are found in the
wp_options table. Any migration tool that migrates your entire install should move these options just fine.
If you want to migrate a few options values, you might want to checkout the WP CLI option command.
In case anyone is still searching this, I was able to accomplish it by going into phpMyAdmin and finding the tables, exporting them, and importing them into the new DB table.
The real tedious part comes when you have to find each option’s “name” in the table. I had one options page, with 1 field, with a bunch of repeater rows, so it was really quick for me. If you have a lot of option values, this may not be the ideal scenario…
In my case, the options were all under “options_clubs” as “Clubs” was the field’s name. Yours will vary and you will have to look in the DB table to find out what they are named. I am using it as an example.
**Keep in mind you need to export/import your fields BEFORE this step.**
1) Log into phpMyAdmin, and go to
wp_options table of your OLD installation.
2) Run the Query:
SELECT * FROM wp_options WHERE option_name LIKE '%options_clubs%' where
options_clubs will be your field name.
3) Once it produces the rows, scroll down to where it says “Query Result Operations” and hit EXPORT
4) Open up the export file it produces, find the SQL code where it is inserting values. It will begin with “INSERT INTO
autoload) VALUES …”
5) Go into phpMyAdmin of the NEW database, go to SQL, and copy/paste that SQL query with all of the values, hit GO.
6) The new values should be loaded into the DB and show up when you log into WordPress in your new Options page.
Repeat for each field you have in an Options page.
I hope this helps someone.
You must be logged in to reply to this topic.
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!
© 2020 Advanced Custom Fields. Subscribe