Maintenance

Implement Safe Import and Export Pipelines for Content

Move content between systems with validation, dry runs, stable identifiers, and recoverable execution.

Imports and exports are high-risk operations because they can create large numbers of records or overwrite valuable content. Treat them as controlled data pipelines rather than one-off scripts.

Define a versioned interchange format

Document required fields, supported content types, locale identifiers, relationship references, and media handling. Include a format version so future changes can be detected and migrated deliberately.

Use stable external identifiers to map source records to destination records. Do not rely only on titles or slugs, which may change or collide.

Validate before writing

A dry run should parse the entire input, report invalid records, missing references, duplicate identifiers, and unsupported fields, and estimate the impact. Do not partially import a file without clearly defining transaction and recovery behavior.

Set limits for file size, record count, nesting depth, and processing time. Treat imported HTML, URLs, filenames, and metadata as untrusted.

Make execution recoverable

Use batches with checkpoints and an import log. Make repeated execution idempotent where possible. Keep a backup or rollback plan before destructive updates.

For exports, exclude passwords, tokens, internal notes, and unpublished records unless explicitly authorized.

Implementation checklist

  • Version the interchange format.
  • Map records using stable external identifiers.
  • Provide dry-run validation and clear reports.
  • Process large imports in checkpointed batches.
  • Exclude secrets and unauthorized content from exports.
Share this page Help other developers discover this resource.