36. ACF Migration | Field Forge - Custom Fields, Built for Speed
Download Log in

36. ACF Migration

Developer Guide

Field Forge can import field groups and values from ACF Pro installations. The migration is safe and non-destructive.

Detection Sources

  1. Database: acf-field-group and acf-field post types.
  2. Local PHP: Groups registered via acf_add_local_field_group().
  3. PostMeta: ACF reference keys in wp_postmeta.
php
$importer = FIELDFORGE_ACF_Import::instance();
$detection = $importer->detect();
// Returns: ['found' => true, 'groups' => 5, 'fields' => 47, 'posts_with_values' => 123, 'source' => 'database']

Group Import

php
$result = $importer->import_groups();
// Returns: ['migrated' => 5, 'errors' => 0, 'log' => [...]]

Before importing database-stored groups, Field Forge de-duplicates ACF group records by key/title and keeps the record with the most direct child acf-field posts. This protects migrations from old ACF databases where an empty duplicate group exists beside the populated group and would otherwise hide nested Repeater, Group, or Flexible Content children.

Value Migration (PRO)

Values are migrated in batches of 50 posts at a time.

php
$offset = 0;
do {
    $result = $importer->import_values_batch( $offset );
    $offset = $result['total_offset'];
} while ( ! $result['done'] );

echo 'Migration complete. ' . $result['migrated'] . ' values migrated.';

Field Type Mapping

ACF TypeField Forge TypeNotes
texttextDirect mapping
textareatextareaPreserves new_lines
numbernumberPreserves min/max/step
imageimagePreserves return_format
filefilePreserves return_format
wysiwygwysiwygPreserves toolbar settings
selectselectPreserves choices
repeaterrepeaterRecursive sub-field import
groupgroupRecursive sub-field import
flexible_contentflexible_contentLayouts and sub-fields
linkurlDowngraded (ACF link has title+target)
google_maptextDowngraded (no map type)
date_time_pickerdate_pickerTime portion dropped

Forge AI Assistant Online

Hi! I'm the Field Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs