Importing & Exporting Devices
You can import and export device configurations as CSV files. This is useful for bulk-creating devices across protocols, migrating configurations between Koios instances, or editing device settings in a spreadsheet.
Exporting Devices
How to Export
There are two ways to export device configurations:
- From the device table — select one or more devices using the checkboxes, then click Export config in the bulk actions menu. Only the selected devices are exported.
- Export all — if no devices are selected, the export includes every device in the system.
The export downloads a file named devices.csv containing one row per device.
What's Included
The CSV contains all configuration fields for each device — general settings and protocol-specific fields. Every column is included regardless of protocol, so columns that don't apply to a particular device's protocol will be empty.
CSV Columns
The export includes these columns:
Core fields:
Protocol-specific fields:
Audit fields (read-only):
Importing Devices
How to Import
- Navigate to the Devices page
- Click the Import button in the table toolbar
- Select a CSV file from your computer
- Review the preview to verify what will change
- Click Confirm Import to apply the changes
CSV Format
The import expects a CSV file with column headers matching the export format. You don't need to include every column — only the fields you want to set. At minimum, new devices require a name and protocol.
How the import determines what to do with each row:
Example: Creating New OPC-UA Devices
To create new devices, leave the id column empty. Provide at least a name and protocol (by ID):
Example: Creating Modbus TCP Devices
Example: Updating Existing Devices
To update existing devices, include the id column with the device's database ID. Only the fields you include will be checked for changes:
Preview Step
After selecting a file, Koios performs a dry run — it processes the CSV without saving anything and shows you exactly what will happen:
- Summary — counts of devices that will be created, updated, skipped, or rejected
- Row details — click any row to see a field-by-field diff of what will change
- Diff table — click Show Diff Table for a full-width view of all changes across all rows, with changed fields highlighted
Validation Rules
The import validates each row against the same rules as the create/update forms:
Boolean fields accept: True/False, true/false, 1/0, yes/no.
Foreign key fields (protocol, parent, opcua_certificate) expect integer IDs.
After Import
Once you confirm the import:
- Devices are created or updated in a single transaction — if anything fails, all changes are rolled back
- An audit event is recorded (e.g. "Imported 10 devices") with your username
- The device table automatically refreshes to show the updated list
- Imported devices begin connecting on the next scan cycle if they are enabled
Tips
- Bulk-create devices for a new site — create one device per protocol, export it, duplicate the rows in your spreadsheet, change the names and addresses, clear the
idcolumn, and import. - Move devices between Koios instances — export from one instance, clear the
idandslugcolumns, verify theprotocolIDs match the target instance, and import on the target. - Audit trail — every import creates an event visible on the Events page, grouped under a single parent event so you can see what was imported in one action.
- Read-only columns —
id,slug,created_at,updated_at, andlast_modified_byare ignored on create. You can leave them in the CSV (useful when round-tripping an export) but they won't overwrite system-managed values. - Sensitive fields — credentials (
opcua_password,soap_rdm_password,rest_password,sql_password) are included in exports. Handle exported CSV files carefully if your devices use authenticated connections.
