Before you start migrating bundled to RDS for AWS, test the connection for both kmrepo and delverepo bundled Postgres databases. This is required to verify passwords for both databases. You must use the same passwords for Kyvos Manager and Kyvos RDS respectively.
Creating Amazon Relational Database Service (RDS)
To create and migrate Kyvos Manager RDS, perform the following steps.
Login to the AWS console.
Navigate to RDS. On the RDS page, click Databases in the left pane.
On the Databases page, click Create database.
Create a new Database instance as per the below settings:
Use Postgres version 13.5.
Provide the name of the Database Instance.
Provide the Master username as kmdbuser for the Kyvos Manager DB Instance.
Provide a password for the Database. (use default password kyvosmanager#123)
Use db.t3.large as the instance type for the KM DB instance.
Specify the Storage.
Create a new security group.
Expand the Additional configuration and change the port from 5432 to 45421.
Provide the database name as kmrepo.
Kyvos Manager RDS Creation and Migration
To create RDS, perform steps from 1 to 3 as mentioned in the ‘Creating Amazon Relational Database Service (RDS)’ section.
Once the RDS instance is created. Open the security group attached to it and edit the inbound rules.
In the inbound rule, pass the port as 45421 and source will be the CIDR of the subnet in which Kyvos is launched.
Login to the Kyvos Manager machine and stop running Kyvos Manager.
Navigate to /data/kyvos/app/postgres/bin.
Take the kmrepo database dump using the following command:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/kyvos/app/postgres/lib
./pg_dump -c -C --host=localhost --port=45421 --dbname=kmrepo --user=kmdbuser --file /tmp/kmrepo.sqlValidate that the file is created, and it has content in it.
Restore the data dump in KM RDS using below command:
./psql -U kmdbuser -p 45421 -h <database_endpoint> -d kmrepo -f /tmp/kmrepo.sqlNavigate to /data/kyvos/installs/kyvosmanager_war/kyvosmanagerdata/server/db/ and take a backup of jdbc.properties.
Open the jdbc.properties and update only the below highlighted properties.
JDBC URL will be: jdbc:postgresql://<endpoint_of_kyvosmanager_RDS>:45421/kmrepo
Make sure the jdbc.username will be kmdbuser
Update the repoIdentifier with the RDS identifier name. - Update the useBundledRepo from true to false
Once done, start the Kyvosmanager and verify the KM application is working as expected.
Kyvos RDS Creation and Migration
To create RDS, perform steps from 1 to 3 as mentioned in the ‘Creating Amazon Relational Database Service (RDS)’ section.
Use database name as delverepo.
Use the database user name as postgres.
Use the same security group that is created for the Kyvos Manager RDS.
Port will be same as 45421.
To take the Database dump for Kyvos Database:
Navigate to /data/kyvos/app/postgres/bin/
Execute the following below commands:
./pg_dump -c -C --host=localhost --port=45421 --dbname=delverepo --user=postgres--file /tmp/delverepo.sqlValidate that the created file must have content.
Restore the Kyvos database dump using the following command:
./psql -U postgres -p 5432 -h cbre-kyvos.ctdjrop6598x.us-east-1.rds.amazonaws.com -d delverepo -f /tmp/delverepo.sqlOnce done, connect to Kyvos RDS using the following commands and make sure the database is restored.
./psql -h <endpoint_of_kyvos_RDS> -p 45421 -U postgres -d delverepo \dt+Once done, navigate to Kyvos Manager > Utilities > Manage Kyvos Repository.
Click External repository.
Provide the repository identifier and click Fetch. It will automatically fill the details.
Click Test.
Once the test connection is successful, click Save.