Switching Repository from External to Installed PostgreSQL
This document describes the procedure for switching both Kyvos Manager (KM) and Kyvos repositories from an external PostgreSQL instance to an installed PostgreSQL service (version 16). The activity involves stopping Kyvos and Kyvos Manager services, exporting and importing database dumps, updating configurations, and validating the migration.
Step 1: Preparatory Actions
Update the passwords for both Kyvos Manager and Kyvos external repositories to match the default passwords used for the installed Kyvos Manager and Kyvos repositories.
Install PostgreSQL 16 service: On the Kyvos Manager node, run the ./configure-postgres16.sh command with sudo user to install PostgreSQL 16 using the Kyvos-provided shell script. Ensure that the PostgreSQL service is running at: sudo systemctl status postgresql post installation.
Use installed PostgreSQL commands: All PostgreSQL-related commands (for dump export and import) should be executed from the installed PostgreSQL directory.
Step 2: Database Export and Import
Export database dumps
Take separate dumps of the Kyvos Manager and Kyvos databases from the external repository using the
pg_dumputility.Use a PostgreSQL version up to 16.9.
Do not use version 16.10 or above, as additional manual edits (removal of unsupported
\restrictand\unrestrictentries) will be required in the dump files.
Example command: pg_dump -U <username> -h <external_host> -p <port> -d <database_name> -f <dump_file_path>
Import database dumps into installed PostgreSQL
Import the KM and Kyvos dumps into the installed PostgreSQL service using the
psqlcommand.Always use postgres as the user (
-U postgres) during import.
Example command: psql -U postgres -d <target_database> -f <dump_file_path>
Note: Any compatibility changes required previously for PostgreSQL 13 are no longer needed, as the installed PostgreSQL version is 16.
TLS Configuration (If Applicable): If TLS is enabled in the deployed cluster using the bundled PostgreSQL, perform the following steps:
Copy the certificate files
server.crtandserver.keyfrom <bundled_pg_base_path>/postgres/data/ to <installed_pg_data_dir> to the data directory of the installed PostgreSQL.Change ownership using sudo chown postgres:postgres /var/lib/pgsql/data/<file-name>.
Enable SSL in
postgresql.conf: ssl=onUpdate the following properties in
postgresql.conf:ssl_cert_file = '<certificate_file_name>' ssl_key_file = '<key_file_name>'Restart the installed PostgreSQL 16 service after making the above changes.
Update KM configuration: In the
jdbc.propertiesfile, update the installedRepo=true parameter before starting Kyvos Manager:Remove or update any
repoIdentifieror outdated repository URL entries as per the installed PostgreSQL connection configuration.Push the following from Kyvos Manager:
KM data snapshot
disaster-recovery.shsnapshot
Update symbolic link on cluster nodes
On each cluster node:
Move the existing
postgresfolder outside thekyvosdirectory.Create a soft link inside the
kyvosdirectory pointing to the relocatedpostgresfolder.
Example command:
ln -s /path/to/postgres /path/to/kyvos/postgres
Step 4: Switch Repository for Kyvos
Using the Kyvos Manager UI, perform the Switch Repository operation for Kyvos.
During this process, Kyvos Manager will automatically update the configuration parameters for Kyvos to point to the installed PostgreSQL repository.
Post-Migration Validation
Start Kyvos Manager and verify that it connects successfully to the installed PostgreSQL repository.
Start Kyvos cluster services and validate connectivity for both KM and Kyvos repositories.
Confirm that all repository-dependent functionalities operate as expected.