BatchPoster#
Post transformed FOLIO objects to FOLIO using batch APIs. This is the general-purpose posting task for loading migration data.
When to Use This Task#
Loading transformed instances, holdings, items to FOLIO
Posting SRS (Source Record Storage) records
Loading users, organizations, orders, and other object types
Posting extradata files (notes, contacts, credentials)
Tip
For inventory objects (Instances, Holdings, Items), you can use either BatchPoster or InventoryBatchPoster. Both offer the same field preservation and upsert capabilities. InventoryBatchPoster uses the folio_data_import library, which is where future development will be focused.
Configuration#
{
"name": "post_instances",
"migrationTaskType": "BatchPoster",
"objectType": "Instances",
"batchSize": 250,
"files": [
{
"file_name": "folio_instances_transform_bibs.json"
}
]
}
Parameters#
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The name of this task. |
|
string |
Yes |
Must be |
|
string |
Yes |
Type of object to post. See Object Types. |
|
integer |
No |
Records per batch. Default varies by object type. |
|
array |
Yes |
List of files to post from the |
Object Types#
Object Type |
API Endpoint |
Notes |
|---|---|---|
|
|
Batch posting |
|
|
Batch posting |
|
|
Batch posting |
|
|
SRS records |
|
|
Uses user-import API |
|
|
One at a time |
|
|
One at a time |
|
Various |
Routes to appropriate API based on content |
Upsert Mode#
Enable upsert to update existing records:
{
"name": "post_instances",
"migrationTaskType": "BatchPoster",
"objectType": "Instances",
"batchSize": 250,
"upsert": true,
"files": [
{
"file_name": "folio_instances_transform_bibs.json"
}
]
}
Note
When using upsert=True, you may want to adjust concurrent requests. Set the FOLIO_MAX_CONCURRENT_REQUESTS environment variable (default: 10).
Source Files#
Location: Files should be in
iterations/<iteration>/results/Format: Newline-delimited JSON (one record per line)
Output Files#
Files are created in iterations/<iteration>/results/:
File |
Description |
|---|---|
|
Records that failed to post |
Report files |
Posting statistics and error logs |
Examples#
Post Instances#
{
"name": "post_instances",
"migrationTaskType": "BatchPoster",
"objectType": "Instances",
"batchSize": 250,
"files": [
{
"file_name": "folio_instances_transform_bibs.json"
}
]
}
Post Holdings#
{
"name": "post_holdings",
"migrationTaskType": "BatchPoster",
"objectType": "Holdings",
"batchSize": 250,
"files": [
{
"file_name": "folio_holdings_transform_mfhd.json"
},
{
"file_name": "folio_holdings_transform_csv_holdings.json"
}
]
}
Post Items#
{
"name": "post_items",
"migrationTaskType": "BatchPoster",
"objectType": "Items",
"batchSize": 250,
"files": [
{
"file_name": "folio_items_transform_items.json"
}
]
}
Post SRS Records#
{
"name": "post_srs",
"migrationTaskType": "BatchPoster",
"objectType": "SRS",
"batchSize": 250,
"files": [
{
"file_name": "folio_srs_instances_transform_bibs.json"
}
]
}
Post Users#
{
"name": "post_users",
"migrationTaskType": "BatchPoster",
"objectType": "Users",
"batchSize": 250,
"files": [
{
"file_name": "folio_users_transform_users.json"
}
]
}
Post Extradata#
{
"name": "post_extradata",
"migrationTaskType": "BatchPoster",
"objectType": "Extradata",
"batchSize": 1,
"files": [
{
"file_name": "extradata_transform_organizations.extradata"
}
]
}
Upsert with Custom Concurrency#
# Set environment variable before running
export FOLIO_MAX_CONCURRENT_REQUESTS=5
folio-migration-tools mapping_files/config.json post_instances --base_folder ./
{
"name": "post_instances",
"migrationTaskType": "BatchPoster",
"objectType": "Instances",
"batchSize": 250,
"upsert": true,
"files": [
{
"file_name": "folio_instances_transform_bibs.json"
}
]
}
Running the Task#
folio-migration-tools mapping_files/config.json post_instances --base_folder ./
See Also#
InventoryBatchPoster - Enhanced posting for inventory with field preservation
MARCImportTask - Loading MARC records via Data Import
UserImportTask - Enhanced user posting