Migrations: source, destination and host¶
Servers reach the end of their support, databases move to new hardware or the cloud, destinations are rebuilt or replaced. This page explains how to move each part without losing changes and, where possible, without new baselines:
- the Replicator Service or Stelo Capture to another computer (a new server, virtual machine or cloud);
- a source database to a new system, address or version;
- a destination to a new server, or to a different kind of destination.
The steps for each component are on their own pages, linked from each section; this page helps you plan, and avoid the mistakes that cost other customers days of baselines.
What a migration has to carry over¶
Incremental replication is a chain: the Capture Agent reads the source's log from a saved position and stages the changes; the Replicator Service applies them and confirms its position; only then does the Capture Agent prune them (see How it works). Each link keeps state in its own place:
| What | Where it's kept | What happens if it's lost or out of step |
|---|---|---|
| Sources, destinations, subscriptions, groups, schedules, service settings, users, macros and secrets | The Replicator Service's control database | Everything must be set up again. |
| The position each incremental group has applied | The control database, confirmed to the Capture Agent after each commit | Restored from an older backup, the group asks for changes the agent may have pruned: those members need a new baseline. |
| Where the control database is | sqdr.properties on the Replicator Service's computer (see The Windows service) |
The service doesn't start. |
| ODBC data sources and drivers | Windows, on the Replicator Service's computer; sources and destinations refer to them by name, which can't be changed in their properties (see Connection Method) | The source or destination can't connect. |
| Licenses | Tied to the computer (see Licensing); the container has keys issued for the container (see License the container) | The service stops replicating. |
| The list of Capture Agents and their configuration | Stelo Capture: the control database SQDRC, each agent's folder conf\agtN, and a copy in the agent's staging database (see Launch Agent and Where the properties are stored) |
The agents must be created again. |
| Staged changes, the agent's subscriptions and its log or journal position | The agent's staging database on the Stelo VM, and possibly a copy of the position in its control schema on the source | Changes not yet applied are lost; without a position, capture can't continue where it stopped. |
| Where the Replicator Service finds the staging database | The Capture Agent schema on the source database, written by the agent at each start from its clientODBCString property, and read by the Replicator Service when you save or Refresh the source (see Incremental Replication) | The Replicator Service keeps connecting to the old staging database. |
| Db2 for i only: the Stelo Capture programs and the exit program that keeps journal receivers the agent hasn't read | The agent's control library on the IBM i (see Update Host) | The agent can't start, or journal receivers it still needs are deleted. |
| The source's log itself: journal receivers, archive logs, binlogs, CDC tables | The source system | If the log from the saved position is gone from the system the agent reads, capture can't continue: the subscriptions need new baselines. |
Three rules follow:
- Move state together, from the same moment. The control database, the staging databases and the source's log position describe one point in the chain. Stop the chain, let it drain, and back up the pieces while nothing changes (see The standard stop).
- Keep names the same where you can. When a new server takes over the old host name (for example through a DNS alias), and data sources, drivers, databases and schemas keep their names, no configuration changes.
- Baselines are needed when capture can't continue. Moving the Replicator Service, the Stelo VM or the destination with its data needs none. A source whose log doesn't continue (a different database, a lost log) or a new Capture Agent always does.
When a new baseline is needed¶
| Situation | New baselines? | Why |
|---|---|---|
| The Replicator Service moves to another computer, with its control database | No | The groups' positions and the Capture Agent's staged changes are unchanged. |
Stelo Capture moves to another server, with its staging databases and SQDRC restored from the same stop |
No | The staged changes and the log positions move with the staging databases. |
| The source moves to new hardware as an exact copy (disk copy, HA role swap, lift and shift), after a quiesce, with no changes until the agent runs again | No | The agent continues on the copy with Warm (restored) (see Moving a source). |
| The source is upgraded in place (new operating system or database version), and its log is kept | No | The agent continues from its saved position. |
The log the agent needs is gone (journal receivers deleted, archive logs expired, a database opened with RESETLOGS) |
Yes | The changes in between can't be read. |
| The source is replaced by another database (a new server built by export and import, a different database product) | Yes | Its log is a different log; a new Capture Agent captures it. |
| The source's Capture Agent Schema changes (a new agent) | Yes | Every incremental group of the source is reset (see Incremental Replication). |
| The destination moves with its data (backup and restore), keeping database, schema and table names | No | The destination holds exactly what was applied before the pause. |
| The destination is replaced (new product, empty database, other names) | Yes | New subscriptions start with a baseline. |
| The control database is restored from an older backup | Check each group | See Back up the control database. |
Plan every migration¶
Take an inventory first¶
Do: before you plan the steps, write down:
- the versions of SQDR and Db2 for LUW, and whether both parts of SQDR share one server;
- which sources and destinations use an ODBC data source (DSN) and which a driver and connection string, and every driver they need, with its exact name;
- which connections use integrated security, and the Windows account each service runs under;
- each Capture Agent's staging database, folder (
agtN) and non-default properties, such as clientODBCString (see Configuration); - each incremental source's Notification Address, the email notification settings, and any SSL certificates or keystores the connections use;
- the credentials you'll need: the local
sqdrWindows account and Db2 users of the Stelo VM, an IBM i user with the installing user's authority for Update Host (Db2 for i), and database users for any new Capture Agent.
Why: most failed cutovers seen by Stelo Support weren't caused by SQDR, but by something on the old server nobody had written down: a data source, a driver version, a machine account granted access to SQL Server, a forgotten password, a firewall rule.
Change one thing at a time¶
Do: move at the same versions, and upgrade SQDR or Db2 as a separate step, before or after. Move one component at a time (the Replicator Service, Stelo Capture, the source, the destination), and check replication after each.
Why: a problem after a combined move and upgrade can come from either, and the rollback has to undo both. Each upgrade has its own steps (see Upgrade on Windows or Upgrade the Docker container). The Replicator Service upgrades its control database when it first starts after an upgrade, and that can't be undone: the way back is the backup taken before the upgrade (see Control database upgrades).
Rehearse, and keep a way back¶
Do:
- Rehearse on a test environment, and time it, including the baselines you can't avoid (see Baselining a large table with partitioned snapshots for the largest tables).
- Keep the old servers as they are until the new ones have run for a while: stop the old services and set them to Disabled, don't uninstall them. Take backups (or an offline snapshot of the virtual machine) at the stop.
- Get the licenses for the new computer before the cutover (see Licenses).
- Make sure the source keeps its log (journal receivers, archive logs, binlogs or change data) for longer than the outage (see Keep the source's journals and logs in check).
Why: a rollback is only quick if nothing on the old side changed; and a log that expires during the outage turns a move that needs no baseline into one that baselines everything.
Licenses¶
The Replicator Service's licenses are tied to the computer (on Windows by its host ID; in the container by the host's IP address), so a new computer needs new keys. Stelo Capture is licensed by processor cores (see License). Ask Stelo Support for the keys, and for temporary keys if the old and new setups must run in parallel; see Obtaining, transferring and upgrading a license.
The standard stop¶
Almost every migration starts with this sequence, which reaches a point where every source change has been captured, staged and applied, and nothing moves any more.
- Stop changes on the source, if it's part of the migration: ask the application owners to keep users and batch jobs off.
- Quiesce the Capture Agent in the SQDR Control Center, and wait until every worker shows Quiesced (see Quiesce). Everything written to the log before the quiesce is then staged.
- Let the groups apply what's staged, until the agent's Subscriptions tab shows no Rows Waiting (see Manage an agent's subscriptions).
- Pause the source in the Data Replicator Manager, which pauses all its incremental groups (see Pause and resume); for a destination migration, pause the destination (see Pause and resume).
- Stop the Capture Agent, or Disable it so that it doesn't start with the Launch Agent (see Stop and Disable).
- For a server move: stop the Replicator Service (
SQDRSVC) and the Stelo Capture services (Launch Agent, Jetty, Derby), and set them to Disabled.
To start again, reverse the order: Db2 for LUW, the Stelo Capture services (the Launch Agent and Jetty depend on Derby), the Capture Agents, then the Replicator Service, which needs its control database at startup (see Start and stop the service). Check each Capture Agent before you resume anything (see Verify after the cutover).
Resume one group first
Resume on a source restarts every incremental group of the source, including groups you had paused on purpose. After a migration, resume one small group with Resume on the group, check that it applies changes, then resume the rest.
Move to another computer¶
The Replicator Service¶
The steps are in Move the service to another computer. What makes them go smoothly:
Do:
- Pause the incremental groups before you back up the control database. The new service then starts with them paused, and you resume them once you've checked the connections.
- Run only one Replicator Service against a control database. Set the old one to Disabled before the new one starts.
- Create the same ODBC data sources, with the same names, and install the same drivers. A source or destination refers to its data source or driver by name, which can't be changed afterwards: a different driver means a new source or destination (see Connection Method).
- Grant the new computer the same database access. Use Integrated Security connects as the account the Replicator Service runs under (see Authentication). For a built-in account, the database sees the computer's own account, which differs on the new computer: add it with the same rights before the cutover.
- Open the network paths from the new computer to every source and destination and to the Stelo Capture staging databases (port 50000 by default, see Ports), and into it on port 7737 for the Data Replicator Manager (see Ports).
- Point the change data notifications at the new computer: each incremental source's Notification Address is where the Capture Agent sends them (see Change data notifications).
- Add the new service to the Data Replicator Manager with Connect To Service, and remove the old one when done.
Why: everything you configured is in the control database, so the new service carries on where the old one stopped. What isn't (data sources, drivers, accounts, network access, licenses) belongs to the computer and must be set up again.
Keep in mind: to move the control database too, or to another server, see Move the control database. Moving it to another type of database (from SQL Server to Db2 for LUW, or back) isn't a backup and restore: contact Stelo Support.
Stelo Capture¶
Moving Stelo Capture means moving, from one stop, everything in the table above that lives on the Stelo Capture server:
- each Capture Agent's staging database (for example
SQDRP0), with the database's backup and restore; - the control database
SQDRC, with the list of Capture Agents (and, when SQDR runs on the same server, the Replicator Service's configuration); - the agents' folders under
C:\ProgramData\StarQuest\sqdrplus\conf; - the Stelo Capture and Db2 for LUW licenses of the new server.
The steps, for the Stelo VM and for Stelo Capture alone, are in Move Stelo Capture to a new server.
Do, after the move:
- If the new server has another host name or address, change each agent's clientODBCString, the connection string the Replicator Service uses to reach the staging database.
- Start each agent. As it starts, it writes the connection string to its control schema on the source.
- For Db2 for i sources, the technical notes also stop the agent, run Update Host with an authorized IBM i user, and start it again.
- In the Data Replicator Manager, on each incremental source's Advanced tab, click Refresh in Incremental Replication, so the Replicator Service reads the new connection string. Agent then shows the new server.
- Resume the groups (see Resume one group first).
Why: the Replicator Service learns where the Stelo VM is from the source, where each agent publishes it. Until the agent has published the new address and the source is refreshed, it keeps connecting to the old staging database.
Operating system upgrades¶
To move to a newer version of Windows, Stelo Support recommends a new server with a clean installation and a migration as above, rather than an in-place upgrade. Check the supported versions in Requirements.
Docker
In the Stelo Replicator container, the configuration, licenses and databases are on the container's volumes (see Volumes). A new image version is an update, not a migration (see Upgrade the Docker container). The container's keys keep working on another host; transferring a license to another host still needs Stelo's approval (see Move or transfer a license). Moving from Windows to the container, or back, isn't an upgrade: contact Stelo Support.
Move or replace a source¶
What you do depends on one question: does the Capture Agent's log continue on the new system?
The same database at a new address¶
The database stays put, but its host name, address or port changes (a network change, a new DNS name).
Do:
- Use host names rather than IP addresses in every connection, so the next address change needs no configuration.
- If a connection's address must change, change it in two places: the Capture Agent's sourceDbUrl and sourceDbHost properties in the SQDR Control Center (saving restarts the agent), and the source's connection in the Data Replicator Manager.
- A source that uses an ODBC data source (DSN) refers to it by name: you can change the data source's server in the ODBC Administrator on the Replicator Service's computer without changing the source. Do it while the source is paused, then restart the Replicator Service so no connection to the old address stays open.
Changing the connection of an incremental source
When you save a new connection string, User ID or Password for an incremental source, the Data Replicator Manager checks the Capture Agent schemas at the new connection and then asks you to confirm that every incremental group of the source will be reset: removed from the Capture Agent and registered again, so that every member needs a new baseline. If no Capture Agent schema is found at the new connection, incremental replication is turned off, and you're asked to confirm that all the source's incremental groups and their members will be deleted permanently. Read each confirmation before you click Yes (see Saving changes and Incremental Replication). When groups must not be reset, keep the connection unchanged: keep the host name, or change the data source instead, as described above.
The same data on a new system¶
The database moves to new hardware, a new virtual machine or a new data center as an exact copy: a disk or storage copy, an HA role swap, a lift and shift. Stelo Support's procedure (for the Db2 for i specifics, see High availability and role swaps):
- Stop changes on the source, quiesce the agent, let the groups apply what's staged, pause the source and disable the agent (see The standard stop).
- Set the agent's Startup Mode to Warm (restored).
- Switch the systems. Check from the Stelo VM that the host name resolves to the new system.
- If the connection changed, update the agent's
sourceDbUrlandsourceDbHost. - Db2 for i: the agent needs its control library, with the Stelo Capture programs, on the new system, and its users with the same authorities. Agree with Stelo Support beforehand whether the library comes over with the system or is installed with Update Host after the switch.
- Start the agent, and wait until each worker shows a current log position and the Diagnostics tab shows no errors.
- Let users back on, make a test change, and resume the groups.
Why: the agent's saved position refers to the old system's log. A non-Normal startup discards it, marks the transactions in progress as rolled back, and checks each subscribed table against its staging table (see How it works). Because the position is discarded, the quiesce and the drain come first, and no source changes may be made until the agent runs again: they wouldn't be captured. A Db2 for i agent also discards its journal positions by itself when the system's serial number differs from the one it stored; set Warm (restored) anyway, since you can't count on the serial number changing.
Keep in mind:
- The log must be on the new system. An Oracle source needs
ARCHIVELOGmode, supplemental logging and, with XStream, its outbound server (see Add a Capture Agent for Oracle); a SQL Server source needs CDC or Change Tracking set up again if the restore didn't keep it. - MySQL and MariaDB: after switching to another server, tell the agent where to start in the new server's binlog with Set Log Position... (see Read the log again from an earlier point).
- High-availability products on IBM i: see Using Stelo Capture alongside HA products.
- Clean up the system you no longer read. On Db2 for i, the exit program keeps journal receivers the agent hasn't read, based on its positions on that system. When the old system stays in use, ask Stelo Support how to release them, so receivers don't accumulate.
An upgrade in place¶
The database or its operating system is upgraded on the same system (for example a new IBM i release), and its log is kept. Pause the source and stop the agent before the upgrade; afterwards, start the agent, check it and resume. Don't delete journal receivers or logs during the upgrade. Check the source version in Requirements.
A different database¶
The source is replaced by a database with its own log: a new server built by export and import, a new database product, a database swap. The old position means nothing there, so:
- Add a Capture Agent for the new database in the SQDR Control Center (see Add a Capture Agent). If the old agent's control schema still exists in the same database, give the new agent another schema.
- In the Data Replicator Manager, either change the existing source's connection and select the new Capture Agent Schema (the groups are reset and every member is baselined), or create a new source and groups and move the subscriptions (see Move or replace a destination for ways to copy them).
- Plan the baselines: they read every table from the new source.
- When the old source is no longer replicated, delete its Capture Agent (see Delete), so it stops holding logs on the old system.
Keep in mind: a copy of a production database, for example to refresh a test system, carries the production Capture Agent's control schema, and with it the entry that tells a Replicator Service where the production staging database is. Give the copy's Capture Agent its own schema, and select it on the test source.
A restored source¶
When the source database, or some of its tables, are restored from a backup, the destination no longer matches it. See Recovery: Warm (restored) when the agent's tables were restored with the database, Force New Baselines or Force Offline when every subscription must start again, and Subscriptions offline and online for a few tables.
Move or replace a destination¶
The same database on a new server¶
The destination database moves to another server with its data (backup and restore), keeping its database, schema and table names.
- Pause the destination (see Pause and resume), and wait until its groups are idle. Changes keep being staged meanwhile.
- Back up the destination database, and restore it on the new server.
- Point the destination at the new server: change its connection string (see Connection Method), or its ODBC data source on the Replicator Service's computer. Confirm Delete Connections: the destination's open connections are closed.
- Resume the destination.
Why: each group's position is in the control database, and the restored database holds exactly what was applied up to the pause, so the groups continue with the next change. Unlike a source, changing a destination's connection doesn't reset any group.
Keep in mind:
- Take the backup after the pause: changes applied after the backup would be missing on the new server, and wouldn't be applied again.
- Changing the connection detects the destination's default database and schema again; these defaults apply to new subscriptions only.
- Keep the database and schema names. Each subscription stores its own destination Database, Object Schema and Object Name (see Destination); changing them means saving every member, and each save of an incremental subscription needs a new baseline (see Plan a baseline for every change).
- With Use Integrated Security, grant the Replicator Service's account the same rights on the new server.
A different destination¶
The destination is replaced by an empty database or a different product (for example SQL Server by Snowflake, Databricks or Microsoft Fabric), or must run in parallel with the old one for a while. An incremental subscription's destination can't be changed, so the subscriptions are created again in groups that use the new destination, and baselined:
- Create the destination (see Create a destination) and an incremental group for it, with an apply method the new destination supports (see Choosing the apply method).
- Copy the members: Copy Subscription from the paused old group to the new group, which creates the copies with the new group's destination and defaults (see Copy or convert); or Export the old group and Import Subscriptions into the new one (see Export and import), also available as PowerShell cmdlets for many groups.
- Check the Columns of a few members: a different kind of destination can map the types differently (see Data type mapping).
- Baseline the new members, run the two destinations side by side until you've checked the new one, then delete the old groups.
Why: while both groups run, the Capture Agent keeps each table's staged changes until both have applied them (see One table appears once per group). An old group left paused after the cutover makes the staging database grow until it's deleted (see Remember what the Capture Agent keeps).
Keep in mind: a snapshot subscription, unlike an incremental one, can be pointed at another destination in its properties.
Verify after the cutover¶
Check each point before you tell users replication is back:
- Each Capture Agent is running, every worker has a current log position, and the Diagnostics tab shows no new errors.
- Each incremental source's Advanced tab shows the right staging database under Agent (click Refresh if not).
- One group, resumed first, applies a test change; then the others are resumed.
- Rows Waiting goes down on the agents' Subscriptions tab.
- Groups apply within seconds of a commit, if they use change data notifications (see Change data notifications).
- No group or member shows an error or an unplanned baseline (see Status).
- Email notifications arrive from the new server, and schedules run.
- The new control and staging databases are in the backup plan.
- The old services stay Disabled; unused Capture Agents and groups are deleted; the old licenses are returned once the old server is decommissioned.
Pitfalls seen in support¶
From a year of support tickets about migrations (about 110, mostly host moves, then source and destination changes), the mistakes that most often caused outages or unplanned baselines:
| What happened | How to avoid it |
|---|---|
| A confirmation after changing a source's connection was answered Yes, and every group of the source was reset and baselined. | Read the confirmations (see the warning above); keep host names so connections don't change. |
The log the agent needed was gone after a long outage: archive logs expired on a managed cloud database, journal receivers deleted during maintenance, a database opened with RESETLOGS. |
Extend log retention before the outage; don't delete receivers; test the procedure first. |
| The agent didn't start on a new IBM i: its control library, its programs or the SQDR user's authorities were missing. | Carry the library over or run Update Host with an authorized user; check the agent before letting users on. |
After a server move, connections with integrated security failed, or the sqdr Windows account kept getting locked. |
Grant the new computer's account the same database rights; create the local sqdr account with the same password; enter the right passwords on the agents. |
| The services started in the wrong order on the new server (Db2 not running), and the agents or the Replicator Service failed. | Start Db2, the Stelo Capture services and the agents first, the Replicator Service last. |
| A driver on the new server had another name or version than on the old one, and the sources using it couldn't connect. | Install the same drivers, with the same names. |
| A cutover combined a move, an upgrade and a change of architecture, and had to be rolled back. | Change one thing at a time; keep the old server intact until the new one has run for a while. |
| An old group was left paused after a move to a new destination, and the staging database kept growing. | Delete old groups after the cutover. |
| The new server wasn't licensed, or a temporary license expired during the parallel run. | Get the keys before the cutover, and track the expiry of temporary keys. |
Related¶
- The Replicator Service: backing up, upgrading and moving it
- Control database: what it holds, backing it up, moving it
- Reliability: Pause before maintenance
- Replicating JD Edwards data for a migration
- SQL4306N on SQDR.GETJARVERSION after an upgrade or migration