Search docs.molo17.com
    Configuration guide Pipelines

    Create entities in bulk by importing a file

    Selecting tables one by one in the Object browser is fine for a few entities. For a whole schema, import a file instead: a list of tables exported from the source database, an Excel sheet, or a YAML file with the settings of each entity. The Control Plane checks every table against the pipeline before anything is written, shows what it will create, lets you fix what is wrong, and saves the entities that are ready. This guide imports the tables of a SQL Server schema into PostgreSQL from a CSV export, adds a filtered entity from a YAML file, and compares the import with the Gluesync Automator.

    In this guide

    You will learn how to export the list of tables from the source catalog, how the import recognizes the columns of the file, how to choose a target schema for all the rows, how to read the results and the CREATE statements, how to fix a table without a primary key and leave out a system table, how to put the entities in groups and save them, what a second import of the same file does, what a YAML file adds, and when to use the Automator instead.

    The steps were run on SQL Server 2022 as the source and PostgreSQL 16 as the target.

    Quick information

    Goal

    Create the entities of a whole schema from one file, check them and save them in the Control Plane

    Audience

    Data engineers and Gluesync administrators

    Level

    Beginner

    Time required

    About 20 minutes

    Area

    Control Plane → Pipelines → Entities → From tables → Import entities

    Applies to

    Gluesync 2.3

    Before you begin

    Make sure that:

    1. Core Hub is 2.3.3 or later for CSV and Excel files. YAML and ZIP files can be imported from Core Hub 2.3.2;

    2. A pipeline exists with its source and target connected. Here the source is SQL Server with CDC on every table: see MS SQL Server CDC source;

    3. Your user has the SUPER ADMIN or MANAGER role: importing creates entities. See User management and role-based access control.

    Which file to use

    File Use it when

    CSV, TSV, TXT or Excel

    You have a list of tables: a catalog export from the source database, or a sheet you fill in. It names the tables and, optionally, their target schema and table, entity name, group and keys. Columns, keys and types come from the database.

    YAML

    An entity needs more than a name: a filter, chosen columns, field functions, a second entity of the same table. This is the format the Automator reads and exports.

    ZIP

    The export of a pipeline from the Automator, with the code of its UDFs and Custom Field Functions.

    Guide steps

    Export the list of tables

    SQL

    Run a query that lists the tables of the source schema and save the result as CSV. On SQL Server:

    SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE
    FROM INFORMATION_SCHEMA.TABLES
    WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA = 'dbo'
    ORDER BY TABLE_NAME;

    The sample schema dbo of the database shop gave:

    TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
    dbo,customers,BASE TABLE
    dbo,items,BASE TABLE
    dbo,order_lines,BASE TABLE
    dbo,orders,BASE TABLE
    dbo,plants,BASE TABLE
    dbo,price_list,BASE TABLE
    dbo,stock_moves,BASE TABLE
    dbo,systranschemas,BASE TABLE

    systranschemas is not a business table: SQL Server creates it in dbo when CDC is enabled on the database. Keep the file as it is for now, to see what the import says about it.

    Any tool that saves a query result as CSV or Excel works. The import also recognizes the catalog columns of Oracle, Db2, SAP HANA, PostgreSQL and the other sources: see How the columns are found.

    Open the import

    UI

    1. Open the pipeline, select Entities, then From tables. The page Listing database objects for database opens, with the Object browser;

    2. Select Import entities in the page header.

    The page Listing database objects for shop with the Import entities button in the header
    Figure 1. Import entities sits in the page header, before Exit and Confirm and continue.

    The link Or import them from a file, under No entities selected, opens the same dialog.

    The dialog Import entities from a file opens on its first step, Choose a file. It explains the two kinds of file and offers three templates under Start from a template: Excel workbook, CSV file and YAML file. Each one downloads a file with every column the import reads and example rows.

    The Choose a file step of the Import entities from a file dialog with the cards YAML or ZIP and CSV or Excel
    Figure 2. The Choose a file step with the templates.
    Choose the file and the target schema

    UI

    1. Drag the CSV file onto the drop zone, or click it and choose the file. A CSV or Excel file opens the Columns step;

    2. Check the columns found. Here Source schema is A: TABLE_SCHEMA and Source table (required) is B: TABLE_NAME: the import recognized the catalog export, and leaves TABLE_TYPE out. To change them, select Edit the columns;

    3. Read the warning No target schema for some rows: the target has no schema named dbo. In Default target schema, choose public. It applies to every row that names no target schema.

    The Columns step for shop-tables.csv with 8 rows
    Figure 3. The Columns step: the catalog columns are recognized, and PostgreSQL has no dbo schema.
    Validate and read the results

    UI

    1. Select Validate. The dialog says Nothing is changed while the file is validated. and shows its progress;

    2. Read the chips above the rows: here Will create table: 6 and Error: 2. Create missing target tables (8) is on: the import creates the target tables when you save;

    3. Expand a row with the arrow at its left. A Will create table row shows its CREATE statement, which you can copy;

    4. Expand the two Error rows, stock_moves and systranschemas.

    Results with Will create table 6 and Error 2
    Figure 4. A table without a primary key is an Error, with the fix in the finding.
    Expected result

    Both errors say No key on the source or on the target (row 8) and (row 9), with How to fix: The table has no primary key. Fill the keys column of this row with the columns that identify a row. The row number is the line of the file, the header being line 1.

    The CREATE statement of customers keeps the source types and the primary key:

    CREATE TABLE "public"."customers" (
       "customer_id" int,
       "name" varchar(80),
       "country" char(2),
       "created_at" timestamp(7) without time zone,
       PRIMARY KEY (
          "customer_id"
       )
    )

    A datetime2 column becomes timestamp(7) in the statement. PostgreSQL accepts it and creates timestamp(6), its highest precision.

    The import listed systranschemas because the file names it: a table the file lists is imported even when its name starts with sys. Leave such tables out of the file.

    Complete the file: keys, groups, no system table

    UI

    The export is a first draft. Complete it with the columns of the import: source_schema, source_table, target_schema, group and keys. Give stock_moves the columns that identify a row, separated by ;, and drop systranschemas:

    source_schema,source_table,target_schema,group,keys
    dbo,customers,public,master-data,
    dbo,items,public,master-data,
    dbo,plants,public,master-data,
    dbo,price_list,public,master-data,
    dbo,orders,public,orders,
    dbo,order_lines,public,orders,
    dbo,stock_moves,public,orders,move_ts;plant_code;item_id
    1. Select the back arrow before the dialog title twice, to go back to Choose a file;

    2. Choose the new file. The Columns step finds the five columns by their names, and no default target schema is needed;

    3. Select Validate, then expand stock_moves.

    Results with Will create table 7
    Figure 5. Every row is ready, and stock_moves gets its primary key from the keys column.
    Expected result

    Will create table: 7, with the group of each row in Group. The CREATE statement of stock_moves ends with PRIMARY KEY ("move_ts", "plant_code", "item_id").

    Add the entities and save them

    UI + SQL

    1. Select Add 7 entities to the selection. The dialog closes; the entities are on the page, not saved yet;

    2. Read the banner: Imported from shop-entities.csv 7 entities are ready to save. An icon next to each entity opens its status and findings, and each entity shows its group. The groups the pipeline does not have yet are created when you save;

    3. Select Confirm and continue.

    The page with the banner Imported from shop-entities.csv 7 entities are ready to save
    Figure 6. The imported entities on the page, before the save.
    Expected result

    You are back on the pipeline, with the seven entities in Hold and the groups master-data and orders. On PostgreSQL, the seven tables exist, each with the primary key of its source table, and stock_moves with the three key columns.

    The pipeline Shop to warehouse with 0 out of 7 operational and the seven entities in Hold
    Figure 7. The saved entities, in their groups, waiting to be started.

    The import does not start the entities. Select the start button of the Hold group, choose Full copy, and select Start entity. Here the seven entities became Active and the row counts on PostgreSQL matched the source. See Start a snapshot and CDC replication.

    Import the same file again

    UI

    Import a file again to add tables you left out, or after changing it. Here the same CSV was imported again.

    Results with Already exists 7
    Figure 8. Entities that exist are Already exists and start unticked.
    Expected result

    Already exists: 7, every row unticked, and Add 0 entities to the selection. Nothing is duplicated. To create a second entity from a table, tick its row and give the entity another name in its settings before saving.

    Add an entity a CSV cannot describe, from YAML

    UI + SQL

    A CSV names tables. For a filter, chosen columns or a field function, use YAML. This file adds a second entity on dbo.orders: only the open orders, into a new table open_orders, with a column loaded_at filled when the row is written:

    schemas:
      dbo:
        target: public
        tables:
          whitelist:
            - orders
          custom:
            orders:
              name: open_orders
              entityName: Open orders
              group: orders
              filter:
                clauses:
                  - {column: status, operation: Equal, value: open}
              columns:
                - {source: order_id, target: order_id}
                - {source: customer_id, target: customer_id}
                - {source: order_date, target: order_date}
                - {source: status, target: status}
                - {source: total, target: total}
                - {target: loaded_at, targetDataType: timestamp(6), expression: {type: LocalTs}}
    1. Import the file as in the steps above, and select Validate;

    2. Expand the row Open orders.

    Results with Will create table 1
    Figure 9. The YAML entity, with its filter and its extra column in the CREATE statement.
    Expected result

    Will create table: 1, with the information An entity of the pipeline already replicates this source table to another target. and a CREATE statement that ends with "loaded_at" timestamp(6). After Add 1 entity to the selection, Confirm and continue and a Full copy, open_orders holds the two open orders, each with its loaded_at:

     order_id | customer_id | order_date | status | total  |         loaded_at
    ----------+-------------+------------+--------+--------+----------------------------
         1001 |           1 | 2026-11-20 | open   | 335.50 | 2026-11-30 14:34:57.68101
         1003 |           3 | 2026-11-25 | open   | 240.00 | 2026-11-30 14:34:57.683402

    Write each mapped column as {source: …​, target: …​}, and give a column that no source column feeds a targetDataType with its length or precision. The troubleshooting table lists what the import said for the other forms. Every key of the YAML format is in Entity import file reference.

    Import in the Control Plane or use the Automator?

    The Gluesync Automator reads the same YAML format. The two tools overlap on creating entities from a file, and differ on everything around it:

    Topic Control Plane import Gluesync Automator

    Where it runs

    In the Control Plane of Core Hub, in your browser. Nothing to install

    A separate program for Windows, macOS or Linux, with a web page on localhost:8080, that signs in to Core Hub

    Files

    YAML, ZIP, and from Core Hub 2.3.3 CSV, TSV, TXT and Excel, with templates in the dialog

    YAML and ZIP. Its Bulk tab picks tables from the live source without a file

    What it creates

    New entities in the pipeline you are on, with their groups and target tables. From a ZIP, also their UDFs, compiled and linked when you save, and the pipeline’s Custom Field Functions, with Compile and publish. See Import a ZIP with UDFs and Custom Field Functions

    Entities, and from an archive whole pipelines with their agents, entities, schedules, UDFs and Custom Field Functions

    Before writing

    Checks every row against the pipeline and shows its status, its findings and the CREATE statement of each new table

    Preview shows the plan of each entity; Dry run goes through it without writing

    Fixing problems

    In the dialog: corrections under a row, Customize in Field mapping, or on the page before saving. The entities that are ready are saved; the others stay on the page

    In the file, or in the Customize panel of an archive (target names, passwords), then run again. Skip errors goes on past a failed entity

    Entities that exist

    Already exists, unticked. A second entity of the same table needs another name

    If the entity is already in the pipeline: keep, skip, update in place or fail

    Created tables

    Keep the source type when the target declares it, and MAX lengths

    Map each type to the target’s default type. See Differences from the Automator

    Schedules, unlocked schemas, custom write policies

    Not created, or the row is Unsupported

    Applied

    Export, backup, restore, duplicate

    Not available

    Available, with or without the agent passwords

    Who can use it

    Users with the SUPER ADMIN or MANAGER role in the Control Plane

    Anyone who can run the program and sign in to Core Hub with a user that manages pipelines

    In short:

    • Use the Control Plane import to add tables to a pipeline you are working on: from a catalog export or a sheet, without installing anything, with each entity checked and the target tables shown before anything is written.

    • Use the Automator to move configuration: export and restore pipelines, copy them between Core Hubs, duplicate them with their agents, or create entities with schedules or settings the import does not support. See Use Gluesync Automator and Promote pipelines from QA to production.

    • Use both: export a pipeline with the Automator and import its YAML or ZIP in the Control Plane, to review every entity before it is created.

    Troubleshooting

    Problem Possible cause What to do

    No target schema for some rows: The target has no schema named dbo.

    The rows name no target schema, and the target has no schema with the source schema’s name

    Choose a Default target schema, or fill the target_schema column

    Error: No key on the source or on the target (row 8)

    The table has no primary key and the row gives no keys

    Fill the keys cell with the columns that identify a row, separated by ;, and import the file again

    A system table such as systranschemas is in the results

    The file lists it: a listed table is imported even when its name starts with sys

    Remove its row from the file, or untick it

    Already exists on every row, and Add 0 entities to the selection

    The entities were already imported

    Nothing to do; to add a second entity of a table, tick its row and rename the entity

    Column order_id is not one of the "targetOnlyColumns" of the table the import creates: no row is written with "source:", so the table is made of those columns alone.

    A YAML with targetOnlyColumns maps the other columns as pairs, such as - order_id: order_id

    Write the mapped columns as {source: order_id, target: order_id}

    The YAML gives loaded_at no type: the import creates it as varchar(1024) and Field function LocalTs does not convert the type of column loaded_at, so it is not applied.

    A column that no source column feeds has no targetDataType on its row

    Add targetDataType to the row, for example timestamp(6)

    Missing required field: loaded_at, with How to fix: Give the length or precision in "targetDataType"

    targetDataType has no length or precision, such as timestamp

    Write it with one, for example timestamp(6) or varchar(50)