Switching Repository from External to Installed PostgreSQL

Switching Repository from External to Installed PostgreSQL

✅ Enterprise: AWS, Azure, GCP, and On-Premises

✅ Marketplace: AWS, Azure, and GCP

✅ SaaS: AWS, Azure, and GCP

✅ Single Node Installation (SNI)


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

  1. 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.

  2. 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.

  3. 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

  1. Export database dumps

    • Take separate dumps of the Kyvos Manager and Kyvos databases from the external repository using the pg_dump utility.

    • Use a PostgreSQL version up to 16.9.

    • Do not use version 16.10 or above, as additional manual edits (removal of unsupported \restrict and \unrestrict entries) 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>

  2. Import database dumps into installed PostgreSQL

    • Import the KM and Kyvos dumps into the installed PostgreSQL service using the psql command.

    • 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.

  3. TLS Configuration (If Applicable): If TLS is enabled in the deployed cluster using the bundled PostgreSQL, perform the following steps:

    1. Copy the certificate files server.crt and server.key from <bundled_pg_base_path>/postgres/data/ to <installed_pg_data_dir> to the data directory of the installed PostgreSQL.

    2. Change ownership using sudo chown postgres:postgres /var/lib/pgsql/data/<file-name>.

    3. Enable SSL in postgresql.conf: ssl=on

    4. Update the following properties in postgresql.conf:

      ssl_cert_file = '<certificate_file_name>' ssl_key_file = '<key_file_name>'
    5. Restart the installed PostgreSQL 16 service after making the above changes.

  4. Update KM configuration: In the jdbc.properties file, update the installedRepo=true parameter before starting Kyvos Manager:

    1. Remove or update any repoIdentifier or outdated repository URL entries as per the installed PostgreSQL connection configuration.

    2. Push the following from Kyvos Manager:

      1. KM data snapshot

      2. disaster-recovery.sh snapshot

  5. Update symbolic link on cluster nodes

    1. On each cluster node:

      1. Move the existing postgres folder outside the kyvos directory.

      2. Create a soft link inside the kyvos directory pointing to the relocated postgres folder.
        Example command:

      ln -s /path/to/postgres /path/to/kyvos/postgres
  6. Step 4: Switch Repository for Kyvos

    1. Using the Kyvos Manager UI, perform the Switch Repository operation for Kyvos.

    2. 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.

Copyright Kyvos, Inc. 2026. All rights reserved.