Skip to main content
Version: V1.4.1

Upgrade embedded seekdb

You can migrate an embedded V1.3.0 or V1.4.0 instance directly to V1.4.1. Use the source runtime to open the old directory and export the application data as SQL. Restore the dump into a fresh V1.4.1 data directory, which uses the new storage format.

1. Stop and back up the source instance​

Record the old data directory, runtime version, application databases, and configuration overrides. Stop all application processes that use the directory. After the instance shuts down, back up the old directory and application configuration. Reserve enough space for the backup, the SQL dump, and the target directory. Store the dump where only authorized users can read it.

Pause application writes and DDL before the final export. Keep them paused through restore, validation, and cutover. If you cancel the migration, confirm that the application still uses the old runtime and directory before resuming writes.

2. Export the source data​

Choose one export method. The examples use /data/backup/seekdb.sql for the dump file.

Export from the data directory​

Use the seekdb-dump command from the Python package that matches the source data directory. Use pylibseekdb==1.3.0.post5 for a V1.3.0 directory and pylibseekdb==1.4.0 for a V1.4.0 directory. For a Node.js or other embedded application, prepare a separate Python environment if the source directory uses the matching format. Keep other processes that use the source directory stopped while the command runs.

After installing the source package in the export environment, set SOURCE_DIR to the old data directory and run the command.

seekdb-dump "$SOURCE_DIR" -o /data/backup/seekdb.sql

By default, the command exports all user databases. Repeat --database NAME to select databases. The dump includes table definitions, indexes, rows, and supported views. Migrate users and grants separately. If the tool reports unsupported objects, resolve the reported objects and rerun the export. Examples include triggers, stored routines, events, and views that depend on databases outside the export. Check that the command succeeds and that the file ends with -- seekdb-dump-complete: true.

Export through a MySQL-compatible endpoint​

If your old binding exposes a MySQL-compatible endpoint, reopen the old directory with that binding and keep the instance open while the SQL client runs. On Linux and macOS, the Python binding uses a Unix socket by default. For example, in an interactive Python session with pylibseekdb==1.4.0, open the source directory and print the socket path.

import pylibseekdb

source = pylibseekdb.open(db_dir="/data/seekdb-v1.4")
print(source.connection_options()["unix_socket"])

Leave that Python session open. In another terminal, set SOURCE_SOCKET to the printed path and run mysqldump with a compatible MySQL client. Replace app_db with the names of your application databases.

mysqldump --protocol=SOCKET --socket="$SOURCE_SOCKET" --user=root \
--skip-lock-tables --skip-add-locks --skip-triggers --hex-blob \
--databases app_db > /data/backup/seekdb.sql

If your binding returns a TCP endpoint, use --protocol=TCP --host=HOST --port=PORT in place of the socket arguments. Use the endpoint and credentials returned by the binding. Add -p if your account has a password. On Windows, use the loopback TCP endpoint if the binding exposes one for application connections. Check that the export succeeded. Then close the temporary source handle, for example with source.close(), if you no longer need the source connection. Migrate required users, grants, and other omitted objects separately.

3. Restore into a fresh V1.4.1 directory​

Keep the original SQL file and check the table definitions in a copy named seekdb-v1.4.1.sql. If a table definition specifies COMPRESSION = 'zstd_1.3.8', change that option to COMPRESSION = 'zstd'. Leave matching values in row data intact.

Use a new, empty target directory, such as /data/seekdb-v1.4.1. Follow the restore procedure for the export method you used.

  • For a file from seekdb-dump, install pylibseekdb==1.4.1 in a separate Python environment. Run the following command while other processes that use the target directory are stopped. The tool starts the target instance, checks the dump's completion marker, and compares restored row counts with the counts recorded in the dump.

    seekdb-restore /data/seekdb-v1.4.1 /data/backup/seekdb-v1.4.1.sql
  • For a file from mysqldump, use a V1.4.1 binding to start the target in the new directory. For example, in a Python session with pylibseekdb==1.4.1, run the following commands.

    import pylibseekdb

    target = pylibseekdb.open(db_dir="/data/seekdb-v1.4.1")
    print(target.connection_options()["unix_socket"])

    Keep the target session open. In another terminal, set TARGET_SOCKET to the target's socket path and import the SQL file.

    mysql --protocol=SOCKET --socket="$TARGET_SOCKET" --user=root \
    < /data/backup/seekdb-v1.4.1.sql

    If the target returns a TCP endpoint, use its host and port with --protocol=TCP --host=HOST --port=PORT. Use the target account and add -p if it has a password. Use a client compatible with the dump. If you export with MariaDB's mariadb-dump, use a compatible MariaDB client to import its output.

If a restore fails, resolve the error and retry in another empty directory.

4. Validate and switch the application​

  1. Run SELECT VERSION(); on the target and confirm that the engine version is 1.4.1.0.
  2. Compare the expected databases, tables, views, indexes, row counts, and key query results. Check any binary, JSON, timestamp, and vector values that your application relies on.
  3. Recreate required users and grants. Reapply configuration overrides that V1.4.1 still supports. See Upgrade seekdb using mysqldump for configuration changes in V1.4.1.
  4. Close any temporary target handle before another process opens the target directory. Configure the application to use a V1.4.1 embedded runtime and the new directory. Verify application reads before resuming writes.

Roll back​

Keep the old runtime, its data directory, and the backup until you accept the upgrade. If the target has received no application writes, stop the application and switch back to the old runtime and directory. If the target has received application writes, pause writes and transfer or reconcile those changes before switching back.