Historical Data Migration
Migrate historical log, event, and audit data from the legacy Elasticsearch PVCs to the ClickHouse or OpenSearch storage used by the new data path.
TOC
Do you need this?PrerequisitesCreate the migration resourceWait for PrecaptureReadyWait for the migration to succeedVerify the migrationDo you need this?
Historical data migration is optional. Once the new data path is live (see Upgrade), it already carries every log, event, and audit record written from cutover onward. This migration only backfills the older data that still lives in the legacy Elasticsearch volumes.
If you skip it, the data written before cutover stays only in the legacy Elasticsearch PVCs and is not queryable from ClickHouse or OpenSearch. Once those source PVCs and PVs are released (see Upgrade, "Retain the source volumes"), that historical data is gone for good. If your site does not need to query the pre-cutover history from the new storage, skip this chapter and release the source volumes once new-storage verification is complete.
Prerequisites
- The source is a Logging 4.3 Elasticsearch deployment. Migrating historical data to 4.4 is supported only from 4.3; other source versions are not supported yet.
- The new data path is
Ready(see Upgrade). - The source Elasticsearch PVCs and PVs still exist and their protection is intact.
- The migration worker image for this release. It is delivered separately from the Logging plugin package — contact Alauda technical support to obtain the image that matches your release. An image that does not match the installed Logging plugin version can fail to exit after data verification. Set it as
spec.imagebelow. - The migrated time range is within the retention of the target tables.
source.indexScope supports exact index names and globs and must match at least one index.
Create LegacyESMigration while the legacy plugin is still installed, before you uninstall it. The operator then captures the source Elasticsearch volumes automatically, so you do not list them by hand.
The source PVCs and PVs must still exist. Once the source PVCs are deleted, or their PVs are released and cleaned up, the historical data cannot be migrated.
Create the migration resource
Choose the tab for your target storage. The two definitions differ only in target.type, the connection Secret, and the options defaults.
Save the YAML as legacy-es-migration.yaml and apply it:
Fallback for an already-uninstalled plugin: if the legacy plugin was uninstalled before this resource was created, the operator can no longer capture the source volumes for you. Add source.pvcRefs listing every retained PVC that backed the legacy Elasticsearch StatefulSets (cpaas-elasticsearch, cpaas-elasticsearch-master); find them with kubectl -n cpaas-system get pvc before they are released. Prefer creating the resource before uninstalling, which avoids this.
Wait for PrecaptureReady
Watch the resource:
Wait for the resource to reach PrecaptureReady. Data copy has not started at this phase.
PrecaptureReady means the source is captured and the volumes are protected. Now uninstall the legacy plugin: follow Upgrade, "Uninstall the legacy Elasticsearch plugin", then return here. (If it was already uninstalled, the copy proceeds on its own.)
If the phase is Blocked or Failed, do not delete or recreate the migration resource, Jobs, source volumes, or new-storage data. Read the condition message and contact Alauda support.
Wait for the migration to succeed
After the legacy plugin is uninstalled, the worker starts copying data. Watch the same resource until the phase is Succeeded:
Do not change the PlatformLogForward or its connection Secret while migration is running.
Verify the migration
Run the production log, event, and audit queries against ClickHouse or OpenSearch and confirm that the historical range is present.
Keep the protected source Elasticsearch PVCs and PVs until verification is complete and cleanup is approved. Phase=Succeeded is not approval to release them.