Skip to content

Import & export

Stages can be exported to JSON files and imported into another shop (or the same shop, as a duplicate). Useful for migrating campaigns between staging and production, sharing pre-built templates across multiple shop instances, or backing up before destructive edits.

On the Marketing → Stages list page, select one or more stages via the row checkboxes. A bulk-action toolbar appears at the bottom:

  • Export selected to JSON — downloads a file containing the picked stages (max 10 per export). Toast: “Exported {count} stage(s)”.

In the row context menu (three-dot button): Export to JSON — downloads that single stage.

The exported JSON snapshot contains:

  • The stage itself (all overview fields — name, type, display type, trigger, frequency, schedule, statistics settings).
  • Every layer with positions, dimensions, animation keyframes, effects.
  • Every slide (for slider stages) with their scene layers.
  • All M:N association IDs (categories, products, manufacturers, product streams, rules, sales channels, customer groups, CMS pages).
  • All media references (by media ID + filename — the actual binaries aren’t embedded; the import wizard handles them).

What’s not included:

  • Statistics events (impressions / CTA clicks / closes / dismissals) — those are runtime data, not part of the stage definition.
  • Drafts and revisions — only the current saved state is exported.

Click Import on the list page. The import wizard opens with five steps.

Select one or more JSON files exported from a stage list. Each file may contain one or many stages.

Click Choose files to pick. Each file is validated by extension (.json) and MIME type — accepted MIME types are application/json, application/octet-stream, text/plain, text/json. Max 5 MB per file, max 20 files per request.

The wizard reads each file, parses its structure, and reports back: “Analyzing {count} file(s)…”“Analysis complete.”

If any file fails to parse, the wizard surfaces the error and lets you remove that file before continuing.

Some referenced entities (categories, products, …) don’t exist in this shop. Map them to local equivalents or leave them empty to skip the link.

This step appears only when the imported JSON references entities that don’t exist locally. For each missing association, the wizard shows:

  • Original ID — the UUID from the source shop.
  • Used by — which stages reference it.
  • Replace with… — a picker to map to a local equivalent (or leave empty to skip the link).

Eight association types are handled: Categories, Products, Manufacturers, Product streams, Rules, Sales channels, Customer groups, CMS pages.

If every reference exists locally, this step is skipped with: “All referenced entities exist in this shop. No mapping required.”

Some media files already exist in this shop with the same filename. Decide what to do for each.

This step appears only when imported media filenames clash with existing media. For each conflicting file, the wizard shows the Existing thumbnail next to the Incoming thumbnail and four actions:

  • Replace existing — overwrite the local file with the imported one.
  • Save as new — upload as a new file with a different name (you supply the new name).
  • Keep existing — link the imported stage to the existing local file, drop the incoming.
  • Skip — no media — drop the media link entirely (the stage will reference no media for that layer).

If no conflicts exist: “No media conflicts. New media will be uploaded fresh.”

Review what will happen and click Import to confirm.

Summary:

  • “{count} stage(s) will be created”
  • “{count} new media file(s) will be uploaded”
  • “{count} media conflict(s) will be resolved”

Click Import to execute. Toast: “Imported {count} stage(s)”. The new stages appear in the list with fresh UUIDs.

If you cancel mid-import: “Import in progress. Cancel anyway?”

Two admin endpoints power the wizard:

  • POST /api/_action/p2lab-stage/import-prepare — accepts a multipart upload of one or many JSON files. Validates them, detects association + media conflicts, returns a structured report the wizard renders.
  • POST /api/_action/p2lab-stage/import-execute — accepts the payload plus the user’s mediaDecisions[] and associationDecisions[] from the wizard, executes the import in a single transaction.

The execute step also regenerates every UUID so the imported stage is fully independent from the original — re-importing the same file twice creates two distinct stages, no collision.

Closely related but in-shop: from the list’s context menu, Duplicate clones a stage in place. Same machinery as import without the file roundtrip — fresh UUIDs, fresh media references (reusing existing media), no targeting associations carried over.

Backed by POST /api/_action/p2lab-stage/duplicate with payload {id: <uuid>}.

  • Editor → Templates — closely related: templates are the in-shop equivalent of import/export for stage content, but exclude targeting.
  • System config — full system settings reference.