Wave database migration
Wave 1.21.0 introduces support for PostgreSQL as the primary database backend, replacing SurrealDB.
This guide outlines the steps to migrate your existing Wave installation from SurrealDB to PostgreSQL.
You will need the following to get started:
- Wave CLI
- A PostgreSQL database accessible to Wave
Database migration
-
Generate build ID, scan ID, token, and mirror ID data to verify your migration in step 3.
-
Run a Wave build operation and capture the
buildId
:wave --conda-package bwa --wave-endpoint <WAVE_ENDPOINT>
-
Verify the build and record the build ID:
curl <WAVE_ENDPOINT>/view/builds/<BUILD_ID>
-
Verify the scan and record the scan ID:
curl <WAVE_ENDPOINT>/view/scans/<SCAN_ID>
-
Create a container augmentation and record the token:
wave -i ubuntu --config-file <CONFIG_FILE> --wave-endpoint <WAVE_ENDPOINT>
-
Verify the container and record the token:
curl <WAVE_ENDPOINT>/view/containers/<TOKEN>
-
Create a mirror operation and note the mirror ID:
wave --mirror -i ubuntu --build-repo <BUILD_REPO> --wave-endpoint <WAVE_ENDPOINT>
-
Verify the mirror and record the mirror ID:
curl <WAVE_ENDPOINT>/view/mirrors/<MIRROR_ID>
-
-
Migrate your database:
-
Add the following to your
MICRONAUT_ENVIRONMENTS
:postgres
surrealdb
migrate
redis
-
Start the Wave application:
INFO i.s.w.s.p.m.DataMigrationService - Data migration service initialized
-
Check the logs for the migration status:
INFO i.s.w.s.p.m.DataMigrationService - All wave_request records migrated.
INFO i.s.w.s.p.m.DataMigrationService - All wave_scan records migrated.
INFO i.s.w.s.p.m.DataMigrationService - All wave_build records migrated.
INFO i.s.w.s.p.m.DataMigrationService - All wave_mirror records migrated. -
When all records are migrated, remove
migrate
andsurrealdb
from yourMICRONAUT_ENVIRONMENTS
, then restart Wave.
-
-
Use the build ID, scan ID, token, and mirror ID you generated in step 1 to verify the migration:
-
Verify the build data:
curl <WAVE_ENDPOINT>/view/builds/<BUILD_ID>
-
Verify the scan data:
curl <WAVE_ENDPOINT>/view/scans/<SCAN_ID>
-
Verify the container data:
curl <WAVE_ENDPOINT>/view/containers/<TOKEN>
-
Verify the mirror data:
curl <WAVE_ENDPOINT>/view/mirrors/<MIRROR_ID>
-
Wave configuration
Add the following properties to your Wave configuration file:
wave.build.logs.path
- Sets the path inside
wave.build.logs.bucket
, where build logs will be stored. wave.build.locks.path
- Sets the path inside
wave.build.logs.bucket
, where conda lock files will be stored.