Importing and Exporting Data
Importing Data
OpenRegister allows you to import configuration data from JSON files. This is useful for:
- Backing up and restoring your configurations
- Migrating data between instances
- Sharing configurations with other users
How to Import
- Navigate to the 'Import' section in the OpenRegister interface
- Click the 'Import Configuration' button
- Choose your JSON file containing the configuration data
- Select whether you want to include objects in the import
- Click 'Import' to start the process
Import Options
- Include Objects: When checked, both schemas and their associated objects will be imported. If unchecked, only schemas will be imported.
Import File Format
Your import file should be a JSON file containing:
- Schemas: The structure definitions for your data
- Objects (optional): The actual data entries that follow these schemas
Example of a valid import file:
{
"schemas": [
{
"name": "Employee",
"description": "Employee record schema",
"fields": [
{
"name": "firstName",
"type": "string",
"required": true,
"description": "Employee's first name"
}
]
}
],
"objects": [
{
"name": "john_doe",
"schema": "Employee",
"data": {
"firstName": "John"
}
}
]
}
Import Validation
The system will validate your import file to ensure:
- The JSON format is correct
- All required fields are present
- Schema references in objects are valid
- Data types match the schema definitions
If any validation errors occur, you'll receive a detailed error message explaining the issue.
Exporting Data
OpenRegister allows you to export your registers and configurations to JSON files. This is useful for:
- Backing up your data
- Sharing configurations with other users
- Migrating data between instances
- Creating templates for new registers
How to Export a Configuration
- Navigate to the 'Configurations' section
- Find the configuration you want to export
- Click the 'Export' button (download icon)
- Choose whether to include objects in the export
- Click 'Export' to download the JSON file
How to Export a Register
- Navigate to the 'Registers' section
- Select the register you want to export
- Click the 'Export' button (download icon)
- Choose whether to include objects in the export
- Click 'Export' to download the JSON file
Export Options
- Include Objects: When checked, both the schema and all associated objects will be exported. If unchecked, only the schema will be exported.
Export File Format
The export file will be a JSON file containing:
- Schema: The structure definition of your register
- Objects (if included): All data entries that follow this schema
Example of an export file:
{
"schemas": [
{
"name": "Employee",
"description": "Employee record schema",
"fields": [
{
"name": "firstName",
"type": "string",
"required": true,
"description": "Employee's first name"
}
]
}
],
"objects": [
{
"name": "john_doe",
"schema": "Employee",
"data": {
"firstName": "John"
}
}
]
}
Error Handling
If any errors occur during the export process:
- A notification will appear explaining the issue
- Check that you have the necessary permissions
- Ensure the register or configuration exists and is accessible
- Try refreshing the page if the issue persists
Best Practices
- Regular Backups: Export your configurations regularly as backups
- Version Control: Keep track of different versions of your exports
- Documentation: Add comments or documentation to explain the purpose of exported configurations
- Validation: Always validate imported files before using them in production
- Security: Store exported files securely, especially if they contain sensitive data