Skip to main content
Version: 1.0.2

Upgrading from v1.0.0-beta.8 to v1.0.0-beta.9

Upgrading from v1.0.0-beta.8 to v1.0.0-beta.9

Because of a change in the underlying way that SurrealDB stores data in this update, and issues with exporting specific data from 1.0.0-beta.8, there are extra steps required to migrate to 1.0.0-beta.9

Issues

  • A change in the underlying way data is stored in SurrealDB was caused by this commit. Data will need to be exported as SQL and imported into 1.0.0-beta.9.

  • In 1.0.0-beta.8, the " character was not yet properly escaped. This was fixed somewhere during the development for 1.0.0-beta.9.

  • The \ character is often used as an escape character, but in an export this is not always properly escaped.This was only recently discovered and is not yet fixed.

Do I have this issue?

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

Error:
thread 'tokio-runtime-worker' panicked at 'called Result::unwrap() on an Err value: Syntax("invalid type: string "Float", expected a boolean")', lib/src/sql/statements/define.rs:1009:72
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Aborted (core dumped)

Because of the above, upgrading the 1.0.0-beta.9 requires some extra steps. We've listed them down below and we advice to follow this migration guide both if you do or do not encounter this issue!

If you use docker, there is a guide by the community that describes a rough example on how to approach this upgrade. You can find it here!

1. Download the special 1.0.0-beta.8 release

We did a special 1.0.0-beta.8 release that ensures that all " characters are escaped when exporting.

2. Start the SurrealDB instance with the temporary 1.0.0-beta.8 binary

You can start the instance with the same arguments as you normally would, only replace the path to the binary.

/path/to/binary/surreal start -u root -p root myolddataset.db

3. Export the data

Please follow the export docs to run the export. Make sure to use the temporarily downloaded binary here.

/path/to/binary/surreal export --conn http://localhost:8000 --ns ns --db db --user root --pass root mydata.surql

4. Stop the SurrealDB instance

Stop the 1.0.0-beta.8 database server, before continuing on to the next step.

5. Install SurrealDB 1.0.0-beta.9

Install 1.0.0-beta.9 database server, using the official docs before continuing on to the next step.

6. Start the 1.0.0-beta.9 SurrealDB instance

Start the new 1.0.0-beta.9 database server, before importing your data.

surreal start -u root -p root mynewdataset.db

7. Import the data

Please follow the export docs to run the export. Make sure to install 1.0.0-beta.9 on your systems first.

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

8. Check for SurrealQL changes in the release notes

There have been major improvements to the SurrealQL language, and also some potential breaking changes for how you have previously defined your schemas. Check out the changes on the release page for 1.0.0-beta.9.