Skip to content

Custom Fields Migration

The 2026-11-11 release moves custom fields off the cards. Each field is now defined once per Board in the fielddefs collection, and each value on a card is stored in the fieldvalues collection. This page describes what the migration does and how to check that it is complete.

The migration runs once, the first time you start a release dated 2026-11-11 or later on a database from an earlier release. You do not start it yourself.

If you upgrade from a release before 2026-09-25, the comments migration runs at the same time. Read that page too.

Before you upgrade

  1. Back up the Mongo database. Earlier releases cannot read the moved fields, so the only way to downgrade is to restore this backup.
  2. Plan the upgrade outside business hours.
  3. Count the cards that have custom fields, so you know the size of the job. Connect to Mongo, open the database that holds the Board nodes, then run:

    db.nodes.aggregate([
      { $match: {
          type: { $in: ['task', 'entry'] },
          fields: { $exists: true, $ne: [] },
          boardId: { $ne: null }
      } },
      { $group: {
          _id: null,
          cards: { $sum: 1 },
          values: { $sum: { $cond: [{ $isArray: '$fields' }, { $size: '$fields' }, 0] } }
      } }
    ])
    

    cards is the number of cards to migrate and values is the number of field values on them. No result means that no card has custom fields.

    This query reads the whole nodes collection, so it can take a while on a large database. Run it once, outside busy hours.

What the migration does

The migration starts in the background when the app service starts. Boards stays available while it runs. If you run more than one app pod, one pod does the work and the others wait for it.

  1. It reads the cards that have custom fields, 1,000 at a time.
  2. For each Board, it creates one field for each name and type that the Board's cards use. Names match without regard to upper and lower case.
  3. For each card, it copies the values into fieldvalues, then removes the old fields from the card. It removes them only after the copy succeeds.
  4. On Boards with cards created from emails, it merges the separate "To (2)", "To (3)"… fields into one To, Cc or Bcc field, and removes the extra fields from the Board. Before it changes a Board, it copies the affected fields and values to the backup_520_fielddefs and backup_520_fieldvalues collections.

These rules apply:

  • Fields with the same name but a different type stay separate. A text field "Due" and a date field "Due" become two fields.
  • A field with no name gets the name of its type: "Text", "Person" or "Date".
  • A card that has the same field twice shows the second as "Name (2)".
  • Values do not change.

What users see

  • Until the migration reaches a card, that card does not show its existing custom fields. They show again once the card is migrated.
  • Users can add and edit custom fields while the migration runs.
  • Boards can be slower while the migration runs, because it adds load to Mongo.

How long it takes

The time depends on the number of cards with custom fields, the Mongo hardware and the other load on Mongo. We cannot give a fixed figure. Most databases take minutes.

To get your own figure before the upgrade, restore a backup to a test environment and upgrade that first.

Warning

Do not restart, delete or scale down the app pods while the migration runs. No field is lost if a pod stops, but the migration then waits up to 15 minutes before it can start again.

Restart an app pod only after the migration has stopped by itself. See If the migration stops.

Check progress in the logs

The migration writes to the log of the app pod that runs it. If you run more than one app pod, check each one.

kubectl get pods -n <namespace> | grep app
kubectl logs -n <namespace> <app-pod-name> | grep -E 'legacy-fields|merge-email-recipients|migration completed fields'

Note

An app pod that starts after the migration is complete logs none of these lines. The same is true of the app pods that waited while another pod did the work. To confirm the result, use the query in Confirm it is complete.

These lines show in this order when all goes well:

Log line Meaning
legacy-fields: migrated { cards: <count>, values: <count>, kept: <count>, ... } All cards are processed. This line shows only if at least one card had custom fields.
migration completed fields/migrate-legacy-flat The field move is recorded as complete.
merge-email-recipients: no legacy To/Cc/Bcc (n) columns: nothing to do No Board has extra recipient fields to merge.
merge-email-recipients: merged { boards: <count>, cards: <count>, ... } The recipient fields are merged. This line shows instead of the line above.
migration completed fields/merge-email-recipients The last step is complete.

On a large database, legacy-fields: progress { cards: <count>, values: <count> } lines can show before the first line.

Confirm it is complete

Each finished step is recorded in the schemamigrations collection:

db.schemamigrations.find(
  { name: /^fields\// },
  { name: 1, completed: 1, result: 1, edited: 1 }
)

The migration is complete when both of these records show completed: true:

  • fields/migrate-legacy-flat
  • fields/merge-email-recipients

The edited date on each record is the time that step finished. The result on fields/migrate-legacy-flat holds three numbers:

Number Meaning
cards Cards that the migration processed.
values Field values that it moved to fieldvalues.
kept Cards that it left unchanged, because a field could not be converted. See If the migration stops.

To count the cards that still have old fields:

db.nodes.countDocuments({
  type: { $in: ['task', 'entry'] },
  fields: { $exists: true, $ne: [] },
  boardId: { $ne: null }
})

After the migration, this returns 0, or the number of cards that the migration left unchanged.

To count what the new collections hold:

db.fielddefs.estimatedDocumentCount()    // fields, one for each field on each Board
db.fieldvalues.estimatedDocumentCount()  // values on cards

If the migration stops

The migration is safe to run again. It removes the old fields from a card only after the values are copied, so a run that stops part-way loses no values. The next run processes only the cards that still have old fields.

What you see Cause What to do
FieldValue: index sync / legacy field migration failed, followed by an error code and message The migration hit an error, or it could not build an index on fieldvalues. Send the line to support.
legacy-fields: ... failed, will retry, followed by a card ID Mongo was unavailable while a card was copied. The card keeps its old fields, and the migration is not recorded as complete. Check that Mongo is healthy, then restart one app pod.
legacy-fields: ... refused, fields kept or legacy-fields: fields left embedded, followed by a card ID A card has a field that cannot be converted. The migration leaves that card unchanged and continues. Send the card IDs to support. No other card is affected.
merge-email-recipients: board failed, will retry The recipient merge hit an error on one Board. The step is not recorded as complete. Restart one app pod. If the line returns, send it to support.
No fields/ records in schemamigrations, and no legacy-fields lines in any app pod log An app pod stopped part-way through within the last 15 minutes, or an earlier step failed. Wait 15 minutes, then restart one app pod. If the records are still missing, send the app pod logs to support.

Restart an app pod

A restart starts the migration again. Do this only when the table above tells you to, and only after you have confirmed that the migration is no longer running:

  1. No app pod has logged a legacy-fields or merge-email-recipients line since the line that reported the problem.
  2. This count stays the same across two readings taken one minute apart. While the migration runs, it changes:

    db.fieldvalues.estimatedDocumentCount()
    

If a new line shows or the count changes, the migration is still running. Leave the pods alone and wait.

Then delete one app pod. Kubernetes starts a new pod in its place, and the new pod starts the migration:

kubectl delete pod -n <namespace> <app-pod-name>

If the migration does not complete after a restart, send the app pod logs and the output of the schemamigrations query to support@huddo.com.

Downgrade

Earlier releases cannot read fields in the fielddefs and fieldvalues collections. To go back to an earlier release, restore the backup you took before the upgrade.