Overview
Theimport command allows you to import existing DAT files from a RomVault installation or any directory containing DAT files. Datoso will automatically detect the seed type for each DAT and add it to the database.
Basic Usage
- Scans the configured DAT root path for
.datfiles - Attempts to detect the seed type for each DAT
- Parses the DAT file structure
- Imports metadata into the Datoso database
Configuration Requirements
Before running import, you must configure the DAT root path:.dat files.
Ignore Specific DATs
Exclude certain DAT files from import:Ignore DAT files matching these patterns (can be used multiple times)
- Filename substrings
- Directory names
- File extensions (though .dat is expected)
Configuration-Based Ignore
You can also configure a permanent ignore pattern using regex:Import Process
Step 1: Scan Directory
Datoso recursively scans the configuredDatPath for files with .dat or .DAT extensions.
Step 2: Detect Seed Type
For each DAT file found, Datoso:- Reads the DAT file structure
- Compares against known seed rules
- Determines which seed the DAT belongs to (e.g., Redump, No-Intro, TOSEC)
Step 3: Parse DAT File
Once the seed type is detected, Datoso:- Uses the appropriate seed parser
- Extracts metadata (name, system, version, etc.)
- Reads game/ROM entries
Step 4: Import to Database
The parsed data is stored in the Datoso database with:- Seed name
- DAT metadata
- Original file path
- Processing status
Output
The import command provides feedback for each file processed:- File path
- Detected seed name
- Parser class used
- Status messages (errors or warnings)
Error Messages
Error detecting seed type (err1):Complete Workflow Example
Initial Setup
Run Import
Verify Import
Use Cases
Migrating from RomVault
If you’re migrating from RomVault to Datoso:Importing Selective Collections
If you only want certain systems:Re-importing After Manual Changes
If you’ve manually modified DAT files:Seed Detection
Datoso uses a rules-based system to detect seed types. The detection process:- Reads DAT metadata - Header, description, version
- Applies seed rules - Matches patterns against known seeds
- Selects best match - Uses the most specific matching rule
Supported Formats
The import command can detect and import DATs from these sources:- Redump - ClrMamePro format with Redump conventions
- No-Intro - ClrMamePro format with No-Intro conventions
- TOSEC - ClrMamePro format with TOSEC conventions
- Other seeds - Any installed seed with detection rules
Unsupported DAT Files
If a DAT file cannot be detected:- Check that it’s a valid ClrMamePro or XML format
- Verify the seed that created it is installed
- Check the DAT header for identifying information
- Consider updating seed rules:
datoso config --rules-update
Behavior Notes
Duplicate Detection
If a DAT is already in the database, the import behavior depends on the file content:- Same content = Skip (no update)
- Different content = Update entry
- Missing file = Add as new
File Path Storage
The original file path is stored in the database asnew_file. This allows:
- Tracking DAT file locations
- Re-importing specific DATs
- Updating from original sources
No File Modification
The import command is read-only and does not:- Modify existing DAT files
- Move or copy files
- Delete any data
Troubleshooting
DAT Root Path Not Set
Error:No DAT Files Found
If import completes but no DATs are imported:- Verify the path contains
.datfiles - Check file permissions
- Ensure files aren’t filtered by ignore rules
- Try with verbose output:
datoso -v import
Seed Type Not Detected
If many DATs show detection errors:- Update seed rules:
datoso config --rules-update - Install missing seed plugins
- Check DAT file format validity
- Review error messages for specific issues
Import Hanging or Slow
For large DAT collections:- Import can take significant time
- Use ignore patterns to process smaller batches
- Check system resources (disk I/O, memory)
- Run with verbose output to see progress
Performance Considerations
Large Collections
For thousands of DAT files:- Import can take 10+ minutes
- Database operations may be slow initially
- Consider importing in batches using ignore patterns
Selective Import
To improve performance:Next Steps
- Query imported DATs with dat commands
- Configure processing with config commands
- Process updated versions with seed commands
- Validate imports with doctor commands