Pro: Export and import require an active Order Daemon Pro licence.
Overview
The WP-CLI export and import commands let you back up your rule configuration or move rules between sites – for example, from a staging environment to production, or from one client site to another.
Export produces a JSON file containing your rules and, optionally, other plugin settings. Import reads that file and applies it to the target site.
Prerequisites
- Order Daemon Pro installed and active on both source and target sites
- WP-CLI access to both sites
- Administrator access or SSH to the server
Exporting rules
wp odcm config export --output=odcm-config.jsonThis exports all plugin configuration (rules, settings) to odcm-config.json in the current directory.
Common options:
| Option | Description |
|---|---|
--output=<file> | Output file path. Default: odcm-config.json |
--format=json | Output format. Currently only JSON is supported |
--components=rules | Export only rules. Use all to include all settings |
--exclude-sensitive | Omit API keys and credentials from the export |
Example – export rules only:
wp odcm config export --output=rules-backup.json --components=rulesExample – export without credentials (safe to commit to a repo):
wp odcm config export --output=rules-backup.json --exclude-sensitiveImporting rules
wp odcm config import rules-backup.jsonImport reads the JSON file and creates or updates rules on the current site.
Warning: Importing will overwrite existing rules with the same slug. Run on a staging environment first to verify the result before applying to production.
Common options:
| Option | Description |
|---|---|
<file> | Path to the configuration file to import (required) |
--dry-run | Simulate the import without making changes |
Example – preview before applying:
wp odcm config import rules-backup.json --dry-runTypical workflow: staging to production
# 1. Export from staging
wp odcm config export --output=rules-staging.json --components=rules --exclude-sensitive
# 2. Transfer the file to production (via scp, rsync, or your deployment system)
# 3. Preview the import on production
wp odcm config import rules-staging.json --dry-run
# 4. Apply
wp odcm config import rules-staging.jsonRelated docs
- CLI & Automation – full reference for all WP-CLI commands
- The Rule Builder – creating and editing rules in the admin UI