Exporting and importing data
Export your current data as a
.surql(SurrealQL) file. You can do this using thesurreal exportcommand 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.surqlThis will create a file called
export.surqlin the current directory.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.surqlImport size limits
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.