Support

Account

Home Forums ACF PRO Process with working with JSON

Solving

Process with working with JSON

  • Hey guys,

    We’re using the JSON files for local > staging > prod deployments with ACF Pro.

    I see you need a modified date to make the JSON files sync, which all makes sense and works for us. We have each shared ACF field as a separate JSON file which can be synced.

    My question was just in terms of workflow.

    At the moment our intended process is:
    1. Delete the JSON file in repo
    2. Make changes to structure in local
    3. Export JSON File
    4. Manually remove square brackets surrounding JSON (needs to these removed or else it wont reimport)
    5. Manually add modified with current date in unix format
    6. Push to git
    7. In staging/prod go into ACF and sync changes

    Three questions:
    – At the end when I try and sync, it says it synced, but sync remains available as an option and not sync actually occurs. Deleting the ACF field in question let’s me bring in the ACF field successfully, but this isn’t ideal.
    – Step 4: Is it possible to export files that don’t need the square brackets removed?
    – Step 5: Is it possible to export with a generated modified date? It’s tedious to have to get and add this each time?

    Thanks

  • Actually ignore my first question about sync – that was due to incorrect timestamp.

  • exporting/importing is different and using local JSON.

    Export/Import creates an array in JSON that can hold multiple groups this is the source of the extra bracket.

    Local JSON stores a single group.

    I’m not sure I understand your process.

    My process:

    1) create an acf-json folder
    2) save field groups which creates json files
    3) commit changes to git repo
    4) pull changes from git repo
    5) upload json changes to server
    6) syn field groups

    However, as far as 6 goes, I only do this on my dev site. You should only sync field groups on the site where you make changes. These groups should not exist in the DB to be edited on sites where they will never be edited. Unless you plan on editing the field groups on staging/production the only place they should exist is as JSON files.

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

You must be logged in to reply to this topic.