Import and Export Wizards
Step-by-step guides for using the visual wizards to import and export data.
Table of Contents
Overview
Data Hub provides visual wizards for common import and export tasks, eliminating the need to write code for simple data operations.
When to Use Wizards
Use Wizards:
- One-time data imports/exports
- Simple field mappings
- Standard Vendure entities (Products, Customers, etc.)
- Quick data migrations
- Ad-hoc reporting
Use Pipelines:
- Scheduled or automated operations
- Complex transformations
- Multi-step workflows
- Real-time integrations
- Custom business logic
Accessing Wizards
- Navigate to Data Hub in the Vendure admin
- Click Import Wizard or Export Wizard
- Follow the step-by-step interface
Import Wizard
Import data from files or external sources into Vendure entities.
Step 1: Choose Template
Select a pre-built template or start from scratch.
Available Templates:
- Products (Basic)
- Products with Variants
- Customers
- Orders
- Inventory
- Collections
- Facets
Starting from Scratch:
Click Custom Import to configure manually.
Step 2: Select Source
Choose where your data comes from.
File Upload
- Click Upload File
- Select file (CSV, JSON, XML, XLSX)
- Configure format options
CSV Options:
- Delimiter (comma, semicolon, tab)
- Has header row
- Quote character
- Encoding (UTF-8, ISO-8859-1, etc.)
JSON Options:
- Array path (for nested data)
- Pretty print
- Encoding
XML Options:
- Root element
- Row element
- Encoding
Excel Options:
- Sheet name or index
- Header row number
- Skip rows
HTTP API
- Enter API URL
- Configure authentication
- Set data path
- Configure pagination (if needed)
Database
- Select connection
- Choose table or enter SQL query
- Preview data
FTP/SFTP
- Select connection
- Enter file path
- Configure format
Step 3: Preview Data
Review first 10 rows of source data.
Actions:
- Refresh preview
- Change format options
- Filter columns
- Transform values
Step 4: Select Target Entity
Choose the Vendure entity to import into.
Available Entities:
- Product
- ProductVariant
- Customer
- Order
- Collection
- Facet
- FacetValue
- Asset
- Tag
- StockLocation
- Channel
- PaymentMethod
- ShippingMethod
- TaxRate
- Promotion
Step 5: Map Fields
Map source fields to target entity fields.
Auto-Mapping
Click Auto-Map to automatically match fields by name.
Matches:
name → name
sku → sku
product_name → name
email → emailAddress
Manual Mapping
Drag source fields to target fields or use dropdowns.
Required Fields (marked with *):
- Depend on entity type
- Must be mapped or have default value
Optional Fields:
- Can be left unmapped
- Use default values
Apply transformations during mapping:
- Click Transform icon
- Select transformation type
- Configure options
Available Transformations:
- Uppercase/Lowercase
- Trim whitespace
- Split/Join
- Date format
- Number format
- Replace text
- Constant value
- Template (combine fields)
Example: Create slug from name
Source: name = "Product Name"
Transform: slugify
Result: slug = "product-name"
Set how data should be imported.
Strategy
CREATE:
- Only create new records
- Fails if record exists
- Fast for bulk imports
UPDATE:
- Only update existing records
- Skips if record doesn’t exist
- Requires match field
UPSERT:
- Create if doesn’t exist, update if exists
- Requires match field
- Most common choice
MERGE:
- Update only changed fields
- Preserves unchanged data
- Slower but safer
Match Field
Field used to find existing records (for UPDATE/UPSERT):
id - Internal ID
slug - URL slug
sku - Stock Keeping Unit
code - Code field
emailAddress - Email (customers)
Conflict Resolution
When source and Vendure data differ:
SOURCE_WINS:
- Always use source data
- Overwrites Vendure values
VENDURE_WINS:
- Keep Vendure data
- Ignore source changes
MERGE:
- Update only changed fields
- Preserves other fields
MANUAL_QUEUE:
- Queue conflicts for review
- Requires manual approval
Validation Mode
STRICT:
- Enforce all validation rules
- Fail on any error
LENIENT:
- Allow some validation failures
- Continue with valid records
Control import performance.
Batch Size:
- Number of records per batch
- Default: 100
- Range: 10-1000
Concurrency:
- Parallel batch processing
- Default: 2
- Range: 1-8
Example Settings:
| Scenario |
Batch Size |
Concurrency |
| Small import (< 1000) |
100 |
2 |
| Large import (> 10,000) |
500 |
4 |
| Complex products |
50 |
2 |
| Simple customers |
200 |
4 |
Step 8: Validation and Preview
Validate data before importing.
Validation Checks:
- Required fields present
- Data types correct
- Format validation (email, URL, etc.)
- Business rules (price > 0, etc.)
- Uniqueness constraints
Preview Changes:
- First 100 records
- Shows what will be created/updated
- Highlights validation errors
Actions:
- Fix errors in source data
- Adjust field mappings
- Change validation mode
- Proceed with import
Step 9: Execute Import
Run the import and monitor progress.
Progress Indicators:
- Records processed
- Success count
- Error count
- Current batch
- Estimated time remaining
Real-Time Logs:
- Import started
- Batch completed
- Validation errors
- Import completed
Actions During Import:
- Pause import
- Cancel import (stops after current batch)
- View detailed logs
Step 10: Review Results
View import results and handle errors.
Summary:
- Total records: 1000
- Successful: 950
- Failed: 50
- Skipped: 0
Failed Records:
- Download error report (CSV)
- View error details
- Fix and re-import
Actions:
- View imported entities
- Download audit log
- Start new import
- Save as template
Export Wizard
Export Vendure data to files or external systems.
Step 1: Choose Template
Select export template or create custom export.
Available Templates:
- Product Catalog (CSV)
- Customer List (XLSX)
- Order Report (JSON)
- Inventory Report (CSV)
- Price List (CSV)
Step 2: Select Source Entity
Choose what to export.
Available Entities:
- All entities available for import
- Plus: Orders, Fulfillments, Payments
Filters:
Add filters to export subset of data:
- Date range
- Status
- Channel
- Custom fields
- Tags
Example Filters:
Entity: Product
Filters:
- enabled = true
- createdAt > 2024-01-01
- tags contains 'featured'
Step 3: Select Fields
Choose which fields to include in export.
Field Selection:
- Check fields to include
- Drag to reorder
- Rename field labels
Related Entities:
- Include variant fields
- Include asset URLs
- Include facet values
- Include custom fields
Choose output format and options.
CSV
Options:
- Delimiter (comma, semicolon, tab)
- Include header row
- Quote all fields
- Line ending (CRLF, LF)
JSON
Options:
- Pretty print
- Array format vs. NDJSON
- Include metadata
XML
Options:
- Root element name
- Row element name
- Include XML declaration
Excel (XLSX)
Options:
- Sheet name
- Freeze header row
- Column widths
- Number formats
Choose where to send exported data.
Download
Export to browser download:
- Immediate download
- Temporary file (deleted after 24h)
File System
Save to server:
- Directory path
- Filename pattern
- Overwrite or append
FTP/SFTP
Upload to remote server:
- Connection
- Remote path
- Filename
S3
Upload to cloud storage:
- Connection
- Bucket
- Key prefix
Email
Send via email:
- Recipients
- Subject
- Body template
- Attachment name
Step 6: Execute Export
Run export and download results.
Progress:
- Records exported
- File size
- Estimated time
Actions:
- Cancel export
- View preview
- Download partial results
Step 7: Review and Download
Download exported file.
Summary:
- Records exported: 5,000
- File size: 2.5 MB
- Format: CSV
- Duration: 45 seconds
Actions:
- Download file
- Schedule recurring export
- Save as template
- Export again
Templates
Save and reuse import/export configurations.
Creating Templates
- Complete wizard configuration
- Click Save as Template
- Enter template details:
- Name
- Description
- Category
- Visibility (Private/Shared)
Using Templates
- Start wizard
- Select template
- Optionally customize
- Execute
Managing Templates
Navigate to Data Hub > Templates
Actions:
- Edit template
- Delete template
- Duplicate template
- Share with team
- Export template (JSON)
- Import template
Field Mapping
Advanced field mapping techniques.
Default Values
Set default values for unmapped fields:
Field: enabled
Default: true
Computed Values
Use expressions to compute values:
Field: slug
Expression: ${sku}.toLowerCase()
Conditional Mapping
Map different sources based on conditions:
Field: price
If: has_sale_price
Then: sale_price
Else: regular_price
Array Handling
Map array fields:
Source: tags (comma-separated)
Transform: Split by ','
Target: tags (array)
Look up related entities:
Field: collection
Lookup: Collection
Match By: slug
Source Field: collection_slug
Validation and Preview
Validation Rules
Built-in Rules:
- Required fields
- Data types
- Format (email, URL, date)
- Min/Max values
- Uniqueness
Custom Rules:
Add custom JavaScript validation:
// Validate SKU format
function validateSKU(value) {
return /^[A-Z0-9-]{4,20}$/.test(value);
}
Preview Changes
Before importing, preview what will happen:
Created Records:
- Shows new entities that will be created
- Highlights required fields
- Shows default values
Updated Records:
- Shows existing entities
- Highlights changed fields
- Shows before/after values
Errors:
- Validation failures
- Missing required fields
- Type mismatches
Troubleshooting
Common Issues
Issue: Import fails with “Required field missing”
Solution:
- Check field mappings
- Ensure required fields are mapped
- Or set default values for required fields
Issue: “Duplicate key” error during import
Solution:
- Check match field is correct
- Verify source data has unique values
- Or use CREATE strategy to skip duplicates
Solution:
- Increase batch size (500-1000)
- Reduce concurrency if database is bottleneck
- Disable validation in lenient mode
- Import during off-peak hours
Issue: Some fields not updating
Solution:
- Check conflict resolution strategy
- Use SOURCE_WINS instead of VENDURE_WINS
- Or use MERGE to update only changed fields
Issue: Date/time parsing errors
Solution:
- Specify date format in transformation
- Common formats:
YYYY-MM-DD
DD/MM/YYYY
MM/DD/YYYY HH:mm:ss
Issue: Export times out
Solution:
- Add filters to reduce dataset
- Export in smaller batches
- Schedule export during off-peak hours
- Increase export timeout in settings
Getting Help
- Check Troubleshooting Guide
- Review import/export logs
- Contact support with:
- Template configuration
- Error messages
- Sample data (anonymized)
Best Practices
Import Best Practices
- Start Small
- Test with 10-100 records first
- Verify results before full import
- Validate First
- Always run validation
- Fix errors before importing
- Use Templates
- Save successful configurations
- Reuse for similar imports
- Backup Data
- Backup database before large imports
- Export current data for rollback
- Monitor Progress
- Watch for errors during import
- Pause if error rate is high
Export Best Practices
- Use Filters
- Only export needed data
- Reduces file size and time
- Schedule Large Exports
- Run during off-peak hours
- Avoid impacting store performance
- Choose Appropriate Format
- CSV for tabular data
- JSON for nested data
- Excel for business users
- Secure Sensitive Data
- Encrypt exports containing PII
- Use secure transfer methods (SFTP, S3)
- Delete temporary files
See Also