hardis:org:configure:data
Description
Command Behavior
Configures a Salesforce Data Migration Utility (SFDMU) project for data export and import operations.
This command assists in setting up SFDMU workspaces, which are essential for managing data within your Salesforce environments. It streamlines the creation of export.json files and related configurations, enabling efficient data seeding, migration, and synchronization.
Key functionalities:
- Template-Based Configuration: Allows you to choose from predefined SFDMU templates or start with a blank configuration. Templates can pre-populate
export.jsonwith common data migration scenarios. - Interactive Setup: Guides you through the process of defining the SFDMU project folder name, label, and description.
export.jsonGeneration: Creates theexport.jsonfile, which is the core configuration file for SFDMU, defining objects to export/import, queries, and operations.- Additional File Generation: Can generate additional configuration files, such as a
badwords.jsonfile for data filtering scenarios. - Scratch Org Integration: Offers to automatically configure the SFDMU project to be used for data import when initializing a new scratch org, ensuring consistent test data across development environments.
See this article for a practical example:
Technical explanations
The command's technical implementation involves:
- SFDMU Integration: It acts as a setup wizard for SFDMU, generating the necessary configuration files that the
sfdmuplugin consumes. - Interactive Prompts: Uses the
promptslibrary to gather user input for various configuration parameters, such as the data path, label, and description. - File System Operations: Employs
fs-extrato create directories (e.g.,data/your-project-name/) and write theexport.jsonand any additional configuration files. - JSON Manipulation: Constructs the
export.jsoncontent dynamically based on user input and selected templates, including defining objects, queries, and operations. - PascalCase Conversion: Uses
pascalcaseto format the SFDMU folder name consistently. - Configuration Persistence: Updates the project's
sfdx-hardis.ymlfile (viasetConfig) to include the newly configured data package if it's intended for scratch org initialization. - WebSocket Communication: Uses
WebSocketClient.requestOpenFileto open the generatedexport.jsonfile in VS Code, facilitating immediate configuration. - Required Plugin Check: Explicitly lists
sfdmuas a required plugin, ensuring the necessary dependency is present.
Parameters
| Name | Type | Description | Default | Required | Options |
|---|---|---|---|---|---|
| debug -d |
boolean | Activate debug mode (more logs) | |||
| flags-dir | option | undefined | |||
| json | boolean | Format output as json. | |||
| skipauth | boolean | Skip authentication check when a default username is required | |||
| websocket | option | Websocket host:port for VsCode SFDX Hardis UI integration |
Examples
$ sf hardis:org:configure:data
