Add whole schemas with Bulk add
Bulk add creates one entity per table for whole schemas, up to tens of thousands of tables in one run. You tick the schemas in the Objects Browser, and a dedicated page checks the agents and their limits, sorts every table with a reason, tells you what will change on both databases, and has Core Hub add the entities and create the missing target tables. Nothing is written before you confirm. Bulk add is available from Core Hub 2.3.3.
Bulk add is for adding a schema’s user tables as they are, each mapped one to one. To bring entities described in a file, with their own mappings and settings, see Import entities from a file. To adjust a single entity, add it on its own in the Objects Browser.
Who can use Bulk add
Bulk add creates entities, so it needs the permission to create entities. The SUPER ADMIN and MANAGER roles have it; other roles don’t see the New Entity page or Bulk add. See User management and role-based access control.
Whole schemas can be picked only on a source whose schemas hold tables you can list. On CouchDB and DynamoDB a "schema" is a server or a region, so their tables are picked one by one, and the schema checkbox is not offered.
Pick the schemas in the Objects Browser
-
Open the New Entity page of the pipeline, the page where you add entities in the Objects Browser. Its breadcrumb reads Add entities.
-
In the Objects Browser, tick the checkbox of each schema you want to add.
Ticking a schema picks every table in it, even a schema you have not opened: Core Hub counts its tables without listing them. Open a picked schema to untick the tables you don’t want, or to tick them back. A schema with some tables unticked shows a partial checkbox.
The tables you pick this way are not listed under Selected entities: they go to Bulk add, which adds them on its own page.
-
Check the count in the bar under the Objects Browser, for example 30000 tables picked, then select Bulk add….
Clear removes the whole pick. Bulk add… stays disabled while entities are listed under Selected entities: confirm or remove them first, as the bar says.
A table already listed under Selected entities can’t be picked for Bulk add as well.
System and Gluesync schemas
The schemas that belong to the database itself, such as sys or pg_catalog, and the schemas Gluesync uses for its own objects are hidden in the Objects Browser. To show them, open the filter menu next to the search and choose Show system schemas (n) or Show Gluesync schemas (n). Each option is offered only when there is a schema with tables to show; a schema with no tables is never listed. See Schema filters.
These schemas can’t be picked whole: their checkbox is disabled, and its tooltip says why, Bulk add leaves out the database’s system tables. or Bulk add leaves out Gluesync’s own tables. Bulk add exists to add a schema’s user tables, and must not sweep in the database’s internals or Gluesync’s own change and staging tables. You can still add one of their tables on its own, for example a SQL Server cdc change table.
The Bulk add page
Bulk add opens at /pipelines/<pipeline id>/bulk-add. Its breadcrumb reads pipeline › Add entities › Bulk add, and its title says how many tables are picked. Under the title, the source and the target database are named with their agent type.
The page leads you through six steps:
| Step | What happens |
|---|---|
Where the tables go: the target schema of each source schema, and the options of the add. |
|
Bulk add lists the tables, matches their targets and reads their columns, and Core Hub checks both agents: prerequisites and limits. Nothing is written. |
|
Every table, in a bucket, with a reason. You decide what happens to the tables that need a decision. |
|
What the add changes on the source, on the target and in Gluesync. You confirm it. |
|
Core Hub creates the missing target tables and the entities. You can close the tab. |
|
You start the new entities, group by group, and read the report: what failed, what was skipped, and what was left behind. |
Up to Add, Back and the step indicator take you to a step you already reached, and Cancel on Targets takes you back to the New Entity page. Changing a target or an option throws away what Check read, and Check reads again.
The pick is kept while the browser tab stays open: reloading the page keeps it. If you open Bulk add with nothing picked, the page says Nothing picked. and asks you to tick schemas or tables in the Objects Browser first.
Bulk add needs both agents to be running: it reads what each agent can do and Core Hub’s request limits before it shows the first step. If it can’t, it says CoreHub did not tell what the agents can do. Check that the agents run, then open Bulk add again.
Step 1: Targets
Under Target schema for each source schema, each source schema picked has a row with its number of tables, its Target schema and its Entity group.
-
Target schema: choose an existing schema of the target. Gluesync creates no schema. A schema named like the source schema is chosen for you when the target has one, case included or else ignoring case. The target’s system and Gluesync schemas are not offered. If a schema is missing, create it on the target, then select reload the target schemas. A target without schemas, such as a document store, keeps the source schema’s name.
-
Entity group: the entities of each source schema go to a group named after it. A group of the pipeline with that name, ignoring case, is reused; otherwise it is created with the entities.
Under Options:
-
Create the target tables that do not exist: on by default, and offered when the target can create tables. Off, a table whose target table doesn’t exist is left out.
-
Include views as snapshot-only entities: offered on sources whose views can be added. Off by default: views are listed in the review, unticked. On, each view becomes a snapshot-only entity, copied once and never captured.
Target tables that already exist are not written into unless you choose so in the review. When the target limits its names, a note under Target names follow the target’s rules. says how many bytes a name can take, or that names must need no quotes. Core Hub names each table as the target stores it, and nothing is renamed for you: two tables that would end up with one name are both held for a decision in the review.
Next: check is available once every source schema has a target schema.
Step 2: Check
Check reads everything the add needs, without writing anything. Under Reading the tables, one bar per phase shows how far it got: Agents and settings, Existing entities, Tables listed, Targets matched, Columns read, Tables sorted.
Then a card per agent, Source agent and Target agent, lists what was checked, each item with a status (Passed, Warning, Blocker, Not checked or Information) and its origin:
-
CoreHub: Core Hub checked it on the agent’s database, without changing anything. These are the agent’s prerequisites, for example Archive log mode on Oracle, WAL level is logical on PostgreSQL or SQL Server Agent on SQL Server, each with the value read and how to fix it. A failed connection is a blocker; any other prerequisite that is not met is a warning, since only the entities that need it, such as those that capture changes, would fail.
-
measured: a limit of the agent, with how much of it is used today and how much this add needs. Core Hub reads it from the database where it can: the objects LogMiner monitors on Oracle, the length of the Db2 CDC output tables argument, the replication slots and WAL senders of a PostgreSQL server.
-
UI rule: what the Control Plane knows of this type of agent and Core Hub doesn’t report, such as a recommended number of tables per agent, or that existing target tables are emptied before their snapshot. These items only warn or inform.
-
listing: what the target listing showed, such as whether the target schemas exist.
On the target card, Bulk add also tells whether the target can create tables, and in transactions, and how many tables are left out because their target table doesn’t exist and table creation is off.
A summary at the top counts the blockers and the warnings. Next: review is available when there is no blocker.
When the add goes over an agent’s limit
If the add would go over a hard limit of an agent, such as the objects Oracle LogMiner can monitor, Too many tables for this agent. shows the limit, what is used today, how many tables can still be added with change capture, and how many are over the limit. Choose what to do with them:
-
Make n snapshot only: the first tables, in the order of the review, keep change capture; the rest are copied once and never captured. When snapshot-only tables count against the limit too, this choice is Leave n out instead.
-
Back to the pick: pick fewer tables in the Objects Browser.
-
Create another pipeline: each agent has its own limit. Create another pipeline with a second source agent on the same database, then bulk add the rest there.
You can change which tables in the review.
Step 3: Review
The review lists every table picked, in one of these buckets, with tiles counting each one:
| Bucket | What it means |
|---|---|
Will be added |
The table becomes an entity. Its Outcome reads Ready when the target table exists and you chose to write into it, or Will create table when Core Hub creates it. |
Needs a key |
The source table has no primary key. It is skipped unless you choose key columns, or add it as snapshot-only where that is allowed (see Tables without a key). Gluesync doesn’t guess a key. |
Target exists |
The target already has a table of that name. It is skipped unless you choose to write into it. |
Snapshot only |
The table is added, copied once and never captured. |
Excluded |
The table is not added, for the reason in the Why column. |
Filter the list with the chips above it, and search it by schema.table on the source or the target. The table shows, for each row, Outcome, Source, Target, Key, Columns and Why, and draws only the rows in view, so it stays fast with 30,000 tables.
Tick or untick a row in the Add column to change what happens to it. A table is never removed from the review: unticking a table moves it to Excluded as Left out by you, and ticking it again undoes that.
Decide for a whole bucket
The Needs a key and Target exists buckets come with a panel to decide for all their tables at once:
-
n tables have no primary key:
-
Choose key columns…: type the key column names, separated by commas, for example
ID, TENANT_ID. They become the key of every table without a primary key; a table that lacks one of them fails when its entity is built, and the report lists it. -
Add as snapshot only: offered when a table without a key can be added snapshot-only (see Tables without a key).
-
Skip all n: leaves them skipped and closes the panel.
-
-
n target tables already exist:
-
Write into them…: choose the target schemas whose existing tables are written into. Each one is emptied at its first snapshot, unless the target keeps its rows (see Tables without a key).
-
Keep skipped: leaves them skipped and closes the panel.
-
Ticking a single row of these buckets does the same for that row: a Needs a key row opens Choose key columns, a Target exists row is written into.
Why a table is excluded
| Reason shown | What it means |
|---|---|
A system object of the database, An object Gluesync created itself |
Core Hub flags the table as the database’s own or as one of Gluesync’s change, staging or capture tables. |
A view: turn on "Include views" at Targets to add it, copied once and never captured |
Views are added only as snapshot-only entities, with the option at Targets. |
Already captured by the entity "name" in this pipeline, Already captured by an entity of the pipeline "name" |
The source table is already the source of an entity. Bulk add doesn’t add a table twice. |
Its target is written already by the entity "name" |
Another entity already writes into the same target table. |
The entity name "name" is taken in this pipeline |
The pipeline already has an entity with the table’s name. |
Goes to the same target as table; nothing is renamed for you |
Two tables end up with the same target name, for example after the target folds the case or cuts the name. |
Its target table table does not exist, and creating the target tables is off at Targets, The target has no such table and cannot create one |
Turn on table creation at Targets, or create the table on the target. |
The name is not allowed on the target, The agent cannot name its capture objects after this table, The name is too long for the agent’s capture objects |
The table’s name can’t be used on the target, or for the objects the source agent creates to capture its changes. |
Another member of the same file is already in the list |
On IBM i, another member of the same file is already added. |
Where it lands on the target could not be told, Its columns could not be read |
Core Hub could not resolve the destination or read the columns. The detail gives the error. |
Over the agent’s limit. Tick to add it as snapshot only |
The table is over an agent’s limit (see When the add goes over an agent’s limit). Tick it to add it as snapshot-only. |
Left out by you |
You unticked it. Tick it to add it again. |
Only the tables over a limit and those you left out can be ticked again from Excluded.
Tables without a key
An entity needs a key to apply updates and deletes. A table without a primary key can still be added as a snapshot-only entity, without a key, when all of these hold:
-
both agents declare that they support it;
-
the target empties its tables before a snapshot, that is, the target agent’s setting Disable truncate on target table before snapshot inserts is off, which is its default.
When the target keeps its tables' rows at a snapshot, running the snapshot of a keyless table again would copy its rows twice, so Core Hub refuses such an entity and Bulk add doesn’t offer it: choose key columns instead. Bulk add says so in Check and in the review, and the texts about existing target tables say their rows are kept instead of emptied.
A keyless snapshot-only entity writes plain inserts, and an unfinished snapshot of it starts over instead of resuming.
The footer counts the entities that will be added, the new target tables, and the tables skipped. Next: confirm changes is available when at least one table will be added and no limit is exceeded.
Step 4: Confirm
Confirm says what the add changes, database by database, before anything is written.
On the source database: shown when saving the entities sets up objects on the source, such as change capture. Under Who turns change capture on, choose:
-
Gluesync turns capture on for each table when it saves the entity: needs the rights for it on the agent’s login. Not available when automatic activation is off on the agent.
-
Your DBA turns it on with a script: the default. Core Hub writes the script once the next step has saved the entities, and the report offers it for download. The entities capture nothing until the DBA has run it, and Start stays locked until you confirm it ran. Not available when only Core Hub could write the agent’s statements.
-
Snapshot only: nothing changes on the source. Every table is copied once and never captured.
Below the choice, What saving sets up on the source lists the setup steps Core Hub would run, from its preview of the first 200 tables: each step per table or once for the database, marked DBA or Gluesync. Steps marked DBA stay with a DBA even when Gluesync turns change capture on. Deleting an entity later doesn’t undo what was set up on its table: the report keeps the script that turns it off.
On the target database: the tables created, and in which schemas; the existing tables written into, emptied at their first snapshot or with their rows kept; and the existing tables left alone.
In Gluesync: the entities and their groups, not started. When webhooks or email digests of the pipeline listen to entity events, it also says how many calls and digest events the add sends: one per entity. Choose the polling interval of the new entities: the agent’s default, or a value in milliseconds, at least 100. A longer interval loads the source less when thousands of tables are polled.
At the end of the page, tick the confirmation: that you have read what the add changes or, with the DBA script, that you will send it to the DBA before starting the entities. When existing target tables are written into, a second box asks you to confirm what happens to their rows. Then select Add n entities.
Step 5: Add
Core Hub runs the add as a bulk entity job: it reads the columns, creates the missing target tables, draws the entity ids and saves the entities in chunks. Bars show the Target tables created and the Entities saved, with the time so far and an estimate of the time left.
The job runs on Core Hub, not in your browser: You can close this tab. Opening Bulk add again on the pipeline shows the progress, or the report once the job has ended.
Stop ends the job after the chunk it is saving. A failure that concerns the whole agent, such as a lost connection or a setup that fails for every entity, stops the job too, and the report shows the cause.
Resume a stopped add
A pipeline runs one bulk add at a time. When you open Bulk add while one runs, the page follows it.
When an add stopped before it finished, opening Bulk add again says A bulk add of this pipeline stopped before it finished., with how many entities are already in the pipeline and how many are still to add. Resume sends the tables again: those already in the pipeline as entities are skipped. Leave it, start a new bulk add starts from your new pick. The job lives in Core Hub’s memory, so this is also how you finish an add that a restart of Core Hub interrupted.
While a bulk add runs on a pipeline, Core Hub refuses to delete the pipeline, to delete an entity group of it, and to unassign its agents.
Step 6: Start and report
The new entities are added, not started.
Start the new entities
Under Start the new entities, the groups of the add are listed with their entities. They start by group, one after the other: Start n groups starts them all, and Start group one of them. Take the initial snapshot is on by default; turn it off to capture changes only. A group that failed to start offers Try again.
A group is started by the ids of the entities this add created, never as a whole group, so other entities of a reused group stay as they are. Starts go to Core Hub 200 entities at a time, each within Core Hub’s request timeout; Started x of y. shows the progress.
If you chose the DBA script at Confirm, Start stays locked until change capture is on: Download the script, send it to the DBA of the source database, and tick The DBA has run the script once it has run. The script is named gluesync-<agent tag>-enable with the extension of the source’s language, such as .sql.
The groups are read again from the pipeline whenever you come back to the tab, so entities deleted since are no longer counted.
Read the report
Four tiles count the entities added, not started, those failed, the tables skipped and the target tables left behind.
-
Failed: the entities that could not be added, grouped by cause, such as Columns could not be read, The target table could not be created, Stopped with the whole agent or Refused by CoreHub, with the first message of each cause and the first entity names. Export as CSV saves
bulk-add-failed.csv, with each entity, its cause and its message. -
Skipped: the tables not added, by reason, the same reasons as in the review (see Why a table is excluded), plus No primary key and Target table exists (not opted in). Export as CSV saves
bulk-add-skipped.csv, with the source, the target and the reason of each table. -
Left behind: what the add created on the databases that no entity uses now: the target tables it created for entities that then failed, and Gluesync objects on the source that no entity uses. Drop these tables and Drop these objects ask for confirmation, then have Core Hub drop them. Core Hub refuses to drop anything an entity of any pipeline uses. A drop can’t be undone.
-
Cleanup scripts: Download disable script saves the script that turns change capture off on the source tables of this add, for later, when you remove the entities.
When the add was stopped before it finished, the report says how many approved tables were not added and offers Resume.
Pipelines with thousands of entities
A bulk add can leave a pipeline with tens of thousands of entities. The pipeline page is built for that:
-
The entity list reads a light list of the entities and draws only the rows in view. Live statuses and metrics update the list at most once a second from 2,000 entities.
-
With a search active, selecting all takes only the entities the search shows, and the selection count and every batch action (Start CDC, Snapshot, Pause, Delete) act only on the selected entities shown. Entities selected before a search hid them stay selected and come back with them.
-
Starts, snapshots and pauses of more than 200 entities go to Core Hub in commands of 200, one after the other, with their progress, for example Started 400 of 27693…. Stop after this command stops the start after the command in flight. If a start stops before it sent every entity, the dialog says how many started and offers Start the other n. A point in time restarts at most 200 entities at once.
-
Saves, deletes and group moves are sent 1,000 entities per request. When another entity write keeps Core Hub busy, the request is sent again, up to three times. If a delete or a group save still fails, the dialog says how many entities it reached, for example Deleted 2000 of 27693 entities.
-
Editing a group of more than 100 entities shows the settings of its first entity. Settings you change are saved to every entity of the group; entities you only add or remove keep their own.
Do it with the REST API
The Bulk add page drives Core Hub’s bulk entity job, POST /pipelines/<pipeline id>/entities/bulk, which you can call from a script too: send one row per table, then follow the job until it ends. Core Hub also caps how many entities one save, validation or delete takes. See Bulk entities in the REST API reference.