How Can I Avoid a Full Refresh When Migrating HVR Hubs to a New Server?
Question
I need to migrate our HVR Hub servers from Amazon Linux to RHEL9. The hubs have high-volume channels, so I want to avoid full refreshes.
How can I snapshot the old hub, migrate it, and resume replication without triggering a full refresh? How should I use the *.cap_state file for a seamless migration?
Environment
- HVR 6
- Environment: High-volume HVR environments
- Server migration: Amazon Linux to RHEL9
Answer
To avoid a full refresh when migrating your HVR hubs and channels:
Suspend the old hub.
i. Suspend capture and integrate jobs using the GUI or hvrsuspend.
ii. Wait until Capture shows no open transactions and the integrate backlog is 0. You can verify the backlog using the Integrate Router Rows metric in the GUI, or by running:
hvrrouterview -s <hub> <chn> | grep capture_router_rows`)Back up the old hub.
Choose one of the following options:
- Option A: Take a VM/EBS snapshot of both the repository database files and
$HVR_CONFIG, then restore them to the new server. No manual database copy is required. - Option B: Take a logical DB backup, such as
pg_dump, and restore to a new database. The schema must remain identical. Copy the$HVR_CONFIGrouter directory, including*.cap_statefiles, to the new server.
- Option A: Take a VM/EBS snapshot of both the repository database files and
Set up the new server.
i. Install HVR 6 on RHEL9.
ii. Use the same hub name, channel names, and location names. Keeping these names unchanged lets us continue replication without a refresh.
Reactivate the channel.
- If all names and directory structure are the same, run hvractivate without custom options to regenerate scripts. Start Capture first, then Integrate.
- If the channel or location names changed, or if you rebuilt the hub, use the
capture_timevalue from the old*.cap_statefile as the Custom Rewind Time when activating the channel. In the GUI, set this value under Capture Start Moment > Custom Rewind Time, or run:
hvractivate -i "YYYY-MM-DD HH:MM:SS" -I now -Jcap -Jinteg <hub> <chn>Start jobs.
i. Start the capture job.
ii. After the integrate backlog reaches 0, start the integrate jobs.
For Custom Rewind Time, use only the capture_time value from the *.cap_state file. We automatically select the correct checkpoint in the source logs and recalculate the remaining configuration.
To reveal the capture time in the *.cap_state file, use the following hvrrouterview command:
hvrrouterview myhub mychn $HVR_CONFIG/hubs/myhub/channels/mychn/locs/src/router/619eaa9c_5c37b-619eaab9.cap_state
For more information, see How to Avoid Issues While Migrating the HVR 6 Hub Server and Repository.