b2c-site-import-export
About b2c-site-import-export
A skill for Salesforce B2C Commerce project maintainers transferring site archives with the b2c CLI. It covers XML import and export, scoped data selection, and verifying changes, including settings outside SCAPI contracts.
Key features
- 01Import and export site archives
- 02Limit exports to selected site data
- 03Author and validate XML against XSD
- 04Verify changes through readback or export
- 05Understand job backends and WebDAV transfer
Use cases
- 01Migrate site configuration archives
- 02Export only campaign or promotion data
- 03Check fields after an import
- 04Handle settings not covered by SCAPI contracts
MCP support
The skill states that no dedicated MCP archive-transfer tool exists; it directs archive imports and exports to the CLI. It also notes that MCP scapi_execute can manage supported Admin fields.
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ salesforcecommercecloud/ b2c-developer-tooling --skill b2c-site-import-exportAfter installing, type/b2c-site-import-exportin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
evals/trigger-evals.jsonreferences/IMPORT-OPTIONS.mdMETADATA-XML.mdWORKFLOWS.mdDetails
From the project READMESite Archives
Use b2c job import / b2c job export to transfer site archives. If b2c is
unavailable, use npx @salesforce/b2c-cli.
Configuration and tool choice
CLI and MCP share resolved configuration: SFCC_* variables (including project
.env), project/shared dw.json, and plugins. package.json provides nonsecret
defaults. Use --project-directory outside the target project. Inspect with
b2c setup inspect --json or MCP config_inspect; keep secrets masked. Configured
values normally make credential flags and manual dw.json reads unnecessary.
For resolution issues, use b2c-cli:b2c-config.
No dedicated MCP archive-transfer tool exists. Use the CLI for XML imports and
exports, including settings absent from SCAPI contracts. MCP scapi_execute can
manage supported Admin fields; a metadata record alone does not prove that
promotion discounts or targeting rules are configured.
Import and verify
- Resolve the target site/catalog and intended change. Include only relevant data in the archive; preserve unrelated settings and requested enabled state.
- Author XML in the platform archive layout. Check the relevant XSD with
b2c docs schema <name>(list names with--list), then validate locally. - Import the directory or zip. The command waits by default;
--show-logshows job logs on failure. Check completion before retrying. - Read back the affected fields. If the API omits them, export the matching data unit and inspect the relevant XML records. A successful job alone is insufficient.
b2c job import ./archive --show-log
b2c job export --site MySite --site-data campaigns_and_promotions --output ./verification
--site alone exports all site data; specify --site-data for focused work.
For a full instance export use --all; --site all, --catalog all, etc. select
every object of one type. Prefer these flags over hand-written --data-units JSON.
Directory output retains the platform's generated *_export root. Do not overwrite
an existing/applied migration. Exports may contain secrets or unrelated defaults;
review and trim before committing, preserving XSD-required fields.
Focused references
- Archive layout and XML workflows: archive workflows.
- Attribute/type XML patterns: metadata XML.
- Remote imports, size splitting, and import-set options: import options.
- Export flags, data units, and compact JSON results: the export reference in the
b2c-jobskill. - Ordered migrations, naming, history, and recovery:
b2c-cli:b2c-import-set-migrations. - Service configuration XML:
b2c:b2c-webservices.
Jobs prefer SCAPI; --api-backend auto can fall back to OCAPI on supported
rejections. Archive transfer uses WebDAV in either case. For job scopes, backend
selection, and monitoring, use the relevant section of b2c-cli:b2c-job.