Merge legacy custom fields before upgrade

Pre-Upgrade Data Consolidation Tool for Legacy Custom Fields

When the new Custom Fields architecture was introduced, legacy custom fields assigned to multiple locations were automatically split into separate fields, each with its own UUID. For example, a single field such as “Internal Reference” that was previously shared between Sales Invoices and Purchase Invoices became two independent custom fields with the same name.

The new Custom Fields system now supports assigning a single field to multiple locations, making this automatic split no longer necessary. Unfortunately, users are still required to upgrade each split legacy field separately, resulting in multiple duplicated custom fields instead of one shared field.

This creates unnecessary complexity, affects data consistency, complicates reporting and API integrations, and increases the maintenance required for Liquid themes and other customizations.

Proposed Solution

Before upgrading legacy custom fields, Manager could provide a Data Consolidation (Merge) Tool that allows users to merge related split fields into a single multi-location custom field.

Because each split field may already contain different data, the merge process should offer configurable conflict-resolution options, such as:

  1. Concatenate Values – Combine values from multiple fields using a user-defined separator.
  2. Primary Source – Use one selected field as the authoritative source and ignore the others.
  3. Priority Order – Read values from fields in a defined sequence, using the first non-empty value.
  4. Custom Formula or Script – Allow advanced users to define how values should be merged.

Benefits

A pre-upgrade consolidation tool would:

  • Eliminate duplicate custom fields created during the migration.
  • Preserve existing data while reducing fragmentation.
  • Simplify reporting, API integrations, and custom themes.
  • Allow users to fully benefit from the new multi-location Custom Fields architecture without carrying forward legacy migration artifacts.

Since the new system already supports shared custom fields across multiple locations, providing a consolidation step before the upgrade would make the migration cleaner, more efficient, and easier to manage.

I’d be interested to hear the community’s feedback as well as the developer’s thoughts on adding this capability.

Custom Field Merge / Consolidation Tool that:

  • Selects multiple custom fields.
  • Creates or chooses a destination custom field.
  • Copies values from the source fields into the destination field for all affected documents.
  • Detects conflicts where more than one source field contains a value.
  • Optionally deletes the source fields after successful migration.