Migrating Database
If you are an existing CCC user planning to upgrade to the latest version and want to migrate your existing database, choose one of the following scenarios based on your current database deployment:
Migrate your PostgreSQL database
Choose one of the following PostgreSQL migration scenarios:
-
Migrate from an external PostgreSQL database to an internal PostgreSQL database
-
Migrate from an internal PostgreSQL database to an external PostgreSQL database
Internal PostgreSQL refers to a database deployed and managed within the CCC container environment. External PostgreSQL refers to a customer-managed PostgreSQL instance running outside CCC.
Migrate your existing PostgreSQL database as is
To migrate your existing PostgreSQL database from a previous CCC version to the latest CCC 4.5 release, first create a backup of the existing database and then restore it into the new CCC deployment. The procedure is described in the Backup and Restore section. This procedure applies to both internal and external PostgreSQL deployments.
Ensure that a verified backup is available before proceeding. Database migration operations require careful handling to prevent data loss or service interruption.
Creating a backup of the old database and migrating
To create a backup of the existing database and migrate it to CCC 4.5, follow the steps described in the Backup and Restore section.
Always validate the backup before proceeding with any migration activity. Refer to the documentation or support resources for guidance specific to your environment.
Migrate from an external PostgreSQL database to an internal PostgreSQL database
The steps involved in migrating your external PostgreSQL database to an internal PostgreSQL database are as follows:
Install CCC using Podman, as explained here: Installing CCC.
Log in to the virtual machine that hosts your existing PostgreSQL database.
Create a dump of the existing database:
pg_dump -h <SOURCE_DB_IP> -p 5432 -U lunadirector lunadirectordb > postgres.sql
Copy the postgres.sql file to the virtual machine running the CCC database container.
Restore the data into the internal PostgreSQL database:
psql -h <DATABASE_IP> -p 5432 -U lunadirector -f postgres.sql lunadirectordb
If CCC is deployed in HA mode, start only the primary database node before performing the migration. Complete the data migration first, then start the standby database nodes, followed by the CCC deployment.
Migrate from an internal PostgreSQL database to an external PostgreSQL database
Before proceeding, ensure that the external PostgreSQL database is freshly installed and does not contain any existing data. Configure the database according to CCC requirements to ensure compatibility and optimal performance.
The steps involved are:
Download and extract the CCC package using the link provided via email.
Log in to the virtual machine running the CCC database container.
Generate a dump of the internal database:
pg_dump -h localhost -p 5432 -U lunadirector lunadirectordb > postgres.sql
Start the target external PostgreSQL database.
Copy the postgres.sql file to the target database virtual machine and restore the data:
psql -h <TARGET_DB_IP> -p 5432 -U lunadirector -f postgres.sql lunadirectordb
Install CCC using Podman or Kubernetes, as explained here: Installing CCC.
After installation completes, log in to CCC and verify that the database data has been migrated successfully.
During CCC installation, while configuring the Master node, provide the external database details such as the database IP address and database password.
Migrate your Oracle database
To migrate from CCC 3.9 with Oracle to CCC 4.5 with PostgreSQL, complete the following two-phase migration sequence to ensure data integrity:
Upgrade CCC 3.9 (Oracle) to CCC 4.0, which migrates the database from Oracle to PostgreSQL. Follow the procedure described in the CCC 4.0 Database Migration Guide.
After completing the CCC 4.0 migration, upgrade the PostgreSQL database to CCC 4.5 by following the PostgreSQL migration steps described in this document.