Migrating Database
If you are an existing CCC user planning to upgrade to the latest version and want to migrate your existing database, consider choosing one of the following scenarios:
Migrate your PostgreSQL database
-
Migrate from external PostgreSQL database to internal PostgreSQL database
-
Migrate from internal PostgreSQL database to external PostgreSQL database
Migrate your existing PostgreSQL database as it is
To migrate your PostgreSQL database as it is from the previous CCC version to the latest version, you have two choices:
Migrating your old database without creating backup
If you've installed CCC using Kubernetes, Helm, or Podman with external database, then update the database IP and SSL status in the ccc_config.env
file, and also update the database password in the secretfile
file, as per the instructions provided in the Installing Crypto Command Center page.
Creating backup of old database and then migrating
To create a backup of the old database and then migrating, follow the guidelines explained under the Backup and Restore section.
Please exercise caution while performing these actions, as handling databases requires care to prevent data loss or application disruption. It is advisable to take necessary backups before proceeding with any changes. Refer to the relevant documentation and seek support resources for detailed guidance based on your specific setup.
Migrate from extrernal PostgreSQL database to internal PostgreSQL database
The steps involved in migrating your external PostgreSQL database to internal PostgreSQL database are:
Install CCC using Podman, as explained here.
Login to the virtual machine that contains your existing PostgreSQL database.
Create a dump of your existing database using the following command:
pg_dump -h IP of source PostgreSQL database -p 5432 -U lunadirector lunadirectordb > postgres.sql
Copy the dump that you’ve created to the podman directory inside the CCC package.
Go the the podman directory inside the CCC package and run the following command to copy the postgres.sql file inside the CCC container:
podman cp postgres.sql ccc:/usr/safenet/ccc/
Run the following command to start data migration to internal PostgreSQL database.
podman exec ccc bash -c 'db-migration --truststore CCC_truststore_password --keystorepass CCC_keystore_password --cccpass CCC_admin_password --dbpass database_password --file filename --copass crypto_officer_password'
If you are using special characters such as # and $ in the password, you need to put a backward slash \ before those characters to avoid errors.
Upon successful completion of the data migration process, you’ll see a confirmation message on your screen. Thereafter, you can login to CCC and check whether the data has been successfully migrated.
Migrate from internal to external PostgreSQL database
Before proceeding, ensure that the external database intended for use is freshly installed and devoid of any existing data. Additionally, configure the database according to the specific requirements outlined for CCC. This ensures optimal performance and a smooth integration with the CCC system.
The steps involved in migrating your internal PostgreSQL database to external PostgreSQL database are:
Utilize the link provided via email to download and extract the CCC package.
Log in to the virtual machine containing CCC with the internal database.
Generate a dump of the existing database by running the following command:
podman exec ccc bash -c "pg_dump 'host=localhost port=5432 dbname=lunadirectordb user=lunadirector password=dbpassword' > postgres.sql"
Transfer the postgres.sql
file from the container to the host machine for future reference.
podman cp ccc:/usr/safenet/ccc/postgres.sql .
Initiate the target PostgreSQL database where you intend to migrate the existing database.
Copy the postgres.sql
file from the previous step to the target database virtual machine and execute the following command:
psql -h IP of target postgres db -p 5432 -U lunadirector -f postgres.sql lunadirectordb
Install CCC using either Podman or Kubernetes, as explained here.
During CCC installation, while modifying the configuration settings in the Master node, you need to provide various database related details, such as IP of the target database and database password.
Upon successful completion of the CCC installation process, you’ll see a confirmation message on your screen. Thereafter, you can login to CCC and check whether the data has been successfully migrated.
Migrate your Oracle database
To move from CCC 3.9 with Oracle to CCC 4.4 with PostgreSQL, complete a two-phase migration and upgrade sequence. This approach ensures continuity and data integrity across both platform and version transitions:
Upgrade your CCC 3.9 Oracle database to CCC 4.0, which converts it to PostgreSQL. Follow the three-step process detailed in the CCC 4.0 Database Migration Guide.
Once the migration to CCC 4.0 is complete, upgrade the PostgreSQL database to CCC 4.4 using the CCC 4.4 Database Migration Guide.