• Start
Sign In

SurrealDB Cloud

/

Operations

Migrating data

SurrealDB Cloud is a hosted version of SurrealDB, providing a fully managed, scalable, and secure database solution. This guide will help you migrate your existing SurrealDB instance to SurrealDB Cloud.

  1. Export your current data as a .surql (SurrealQL) file. You can do this using the surreal export command in the terminal:

# Example export command to export data to a file called `export.surql` in the downloads directory.
surreal export --conn <connection-url> --user root --pass secret --ns main --db main downloads/export.surql
  1. This will create a file called export.surql in the current directory.

  2. You can now import this file into your SurrealDB Cloud Instance.

surreal import --conn <connection-url> --user root --pass secret --ns main --db main downloads/export.surql

Cloud instances run the SurrealDB defaults, so an import is accepted up to 4 GiB per request. The limit is cumulative for the whole request, not per chunk, so a single export file above the cap cannot be loaded in one go and must be split across several files.

An import is applied statement by statement as it is parsed, and each statement commits as it goes. If an import fails partway through, the data applied up to that point stays in the database. When migrating into Cloud, the simplest way to keep a retry clean is to import into a fresh namespace or database and switch over once the import has completed.

See request size limits for the caps that apply to every endpoint.

Was this page helpful?