Migrating your data can be done through Surreal Sync, a command-line tool that allows you to directly migrate data from another source into a running SurrealDB database through a single command such as the following.
SOURCE_URL=mongodb://user:pass@localhost:27017 \ surreal-sync sync mongo-db \ --source-database "mydb" \ --to-namespace "production" \ --to-database "migrated_data"
WarningSurreal Sync is currently in active development and is not yet stable. We are looking forward to any and all feedback on the tool, either via raising an issue or PR on the Surreal Sync repo, or anywhere else in the SurrealDB community.
This tool can currently be used to migrate data from the following sources:
Most data types are fully supported, meaning that there is a SurrealQL format that matches the originating type.
For example, Neo4J’s Duration
and Bytes
and String
are converted to SurrealQL types of the same name: duration
, bytes
, and string
, and MongoDB’s TimeStamp
and Double
are converted to datetime
and float
.
Partially supported data types are types that do not have a direct SurrealQL equivalent that could be used without data loss. These types are brought in as an object with fields that preserve the original data.
For example, Neo4J’s Point3D
type is turned into a GeoJSON-like object that includes an array of three floats for a point’s longitude, latitude, and elevation:
{ "type": "Point", "srid": 4979, "coordinates": [longitude, latitude, elevation] }