SurrealDB Docs Logo

Enter a search query

Back to home
SurrealDB

SurrealDB

Upgrading to 2.0.0-beta

The 2.0.0-beta release of SurrealDB includes many new features, improvements, and bug fixes. However, because of changes in the underlying way that SurrealDB stores data, three steps are required to migrate to 2.0.0-beta. We’ve listed them below, and we advise following this migration guide whether or not you encounter this issue!

Issues

Do I have this issue?

If you are experiencing this issue, an error similar to the following will be thrown when connecting to the database or when selecting specific data.

error: Storage version is out-of-date.

Moving from 1.x to 2.0.0-beta

A new surreal fix command has been implemented to automatically change the format of your stored data. The command is followed by a path to the data. Two examples:

surreal fix surrealkv://mydata

surreal fix rocksdb:somedatabase

Moving from 2.0.0-alpha to 2.0.0-beta

The surreal fix command above has been created specifically for 1.x instances. However, data currently on a 2.0.0-alpha instance can still be manually exported and then reimported into a project running on 2.0.0-beta via the following steps.

  1. Export your current data as SQL. 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 http://localhost:8000 --user root --pass root --ns test --db test downloads/export.surql
  1. This will create a file called export.surql in the current directory.

  2. You can now import this file back into your project running on 2.0.0-beta.

surreal import --conn http://localhost:8000 --user root --pass root --ns test --db test downloads/export.surql

Check for changes in the release notes

There have been major improvements to SurrealDB in 2.0.0 release both in alpha and beta. Check out the changes on the release page.

© SurrealDB GitHub Discord Community Cloud Features Releases Install