Skip to main content
A streamlined 2-step process to migrate data from Kuzu graph database into FalkorDB using automated schema discovery and CSV export.

Overview

This migration tool bridges the gap between Kuzu and FalkorDB by:
  1. Automatically discovering your Kuzu database schema
  2. Exporting all nodes and relationships to properly formatted CSV files
  3. Loading these CSV files into FalkorDB using the FalkorDB Rust loader
The process ensures complete data migration including nodes, relationships, properties, and metadata.

Features

  • Automatic Schema Discovery: Dynamically discovers all node types and relationship types in your Kuzu database
  • FalkorDB Compatibility: Generates CSV files in the exact format expected by FalkorDB
  • Intelligent Label Mapping: Maps Kuzu relationship names to standardized FalkorDB edge types
  • Complex Property Handling: Properly handles lists, nested values, and various data types
  • Comprehensive Export: Exports both nodes and relationships with full metadata
  • Schema Documentation: Optional JSON schema file generation for documentation purposes

Prerequisites

Installation

  1. Install the required dependencies:
  1. Download the migration script:

Step 1: Exporting from Kuzu

Basic Usage

Export all data from a Kuzu database:

Advanced Usage

Command Line Options

Output Structure

The export script generates the following files: Node CSV Files:
  • Format: nodes_<NodeType>.csv
  • Structure: id,labels,property1,property2,...
  • Example: nodes_Application.csv, nodes_Machine.csv
Edge CSV Files:
  • Format: edges_<EdgeType>.csv
  • Structure: source,source_label,target,target_label,type
  • Example: edges_CONNECTS.csv, edges_CONTAINS.csv
Schema File (Optional):
  • File: schema.json
  • Contains: Export metadata, node types, relationship types, and file mappings

Example Export Output

Step 2: Loading into FalkorDB

Use the high-performance FalkorDB Rust Loader to load the exported CSV files directly into FalkorDB.

Installation

The binary will be available at target/release/falkordb-loader.

Basic Usage

After exporting your Kuzu database to CSV files, load them into FalkorDB:
This command will:
  1. Connect to FalkorDB (localhost:6379 by default)
  2. Create the graph my_graph
  3. Load all CSV files from the csv_output directory
  4. Create indexes and constraints automatically

Advanced Usage

For more control over the loading process:

Command-Line Options

Performance Features

The Rust loader provides significant advantages for loading Kuzu exports:
  • Async Operations: All database operations use async/await for better concurrency
  • Batch Processing: Processes multiple records per query (default: 5000)
  • Memory Efficient: Streams data from CSV files without loading everything into memory
  • Progress Tracking: Real-time progress updates during loading
  • Error Handling: Comprehensive error handling with detailed logging

Example Output

Performance Tips

  1. Match export and loader directories: If you used --output my_csv_export during export, use --csv-dir my_csv_export when loading
  2. Adjust batch size: For very large datasets, you might want to increase batch size: --batch-size 10000
  3. Monitor progress: Use --progress-interval to get regular updates
  4. Enable verbose logging: Set RUST_LOG=debug for detailed information
  5. Use stats: Add --stats to see a summary of loaded data after completion

Data Mapping Features

Relationship Mapping

The script intelligently maps Kuzu relationship names to standardized FalkorDB edge types, ensuring consistent naming conventions.

Label Enhancement

The script enhances node labels with context for better FalkorDB compatibility:
  • Process nodes in different contexts: Application:Process, Service:Process, or OS:Process
  • Network zones: Network:Zone
  • Service software: Software:Service

Error Handling

The migration script includes robust error handling:
  • Validates database path exists
  • Handles missing relationship types gracefully
  • Continues export even if individual tables fail
  • Provides detailed progress and error messages

Troubleshooting

Common Issues

  1. Database not found: Ensure the database path is correct and accessible
  2. Permission errors: Check write permissions for the output directory
  3. Memory issues: For very large databases, consider adjusting batch sizes or processing in chunks

Debug Mode

For additional debugging information, you can modify the script to include more verbose logging or add print statements to track the export process.

Additional Resources

Next Steps

Frequently Asked Questions

No. The tool uses automatic schema discovery to dynamically detect all node types and relationship types in your Kuzu database. Optionally, generate a schema.json for documentation.
The script intelligently maps Kuzu relationship names to standardized FalkorDB edge types. For example, INSTANCE_APP_SW becomes INSTANCE as the edge type.
Yes. Adjust the --batch-size parameter (try 10000 for large datasets), use the Rust loader for performance, and monitor progress with --progress-interval. The streaming approach avoids loading everything into memory.
Python 3.9 or higher is required, along with the kuzu Python package. Install with pip3 install kuzu.