This article describes how to use IBM App Connect to create an event-driven flow that migrates data between object storage services like Amazon S3 and IBM Cloud Object Storage.
Amazon S3 is capable of holding large amounts of data, such as backups and archives, and large individual files, such as video files, image files, and genomic data. Cloud Object Storage is a reliable, durable, and resilient cloud storage service.
Suppose your organization needs to move all data from a partner cloud storage system like Amazon S3 to Cloud Object Storage. This task involves the transfer of a large amount of data. By using a batch retrieve operation in App Connect, you can extract all the files from an Amazon S3 bucket and upload them to a Cloud Object Storage bucket.
Before you start: This article assumes that you’ve created accounts for Amazon S3 and Cloud Object Storage.
Connecting App Connect to Amazon S3 and Cloud Object Storage
From the App Connect catalog, select Amazon S3, click Connect, and enter the requested connection details. Mandatory fields are marked with an asterisk (*). Click Connect again to connect to your Amazon S3 account. Repeat this step to connect to your Cloud Object Storage account.
Creating your flow
- On the App Connect dashboard, click New > Event-driven flow and enter an appropriate name for your flow.
- On the Toolbox tab, select Scheduler to add it as the trigger event of your flow.
- Configure the scheduler by setting the type to
Repeating interval, and setting it to run every hour. Also select the checkbox to make the flow run when it’s first switched on.
- Click the plus icon (+), and from the Toolbox tab, select Batch process to add it to the flow.
- To specify the data that you want to retrieve, select Amazon S3, expand Objects, then click Retrieve all objects to add this as the first action of the batch process.
- Click Add condition and enter the name of the bucket from which you want to extract objects.
- Click the plus icon (+) in the batch process to add another retrieve action. Select Amazon S3, click Show more, expand Objects, and click Retrieve object content.
- Configure the “Retrieve object content” action by selecting the appropriate bucket, and mapping the object name to the object name of the “Retrieve all objects” action.
- Click the plus icon (+) in the batch process to add another action. Select IBM Cloud Object Storage S3, expand Objects, then click Create object.
- Configure the Cloud Object Storage “Create object” action by selecting the appropriate bucket, and mapping the Object name and Object content fields of the Cloud Object Storage “Create object” action to the equivalent Amazon S3 fields.
Note: The date function “$now()” is appended to the object name to ensure that the object name is unique in Cloud Object Storage. If the date function wasn’t added, the flow would fail after the first successful run because the object name already exists.
The completed flow should look like this:
Test the flow
Run the flow and check that the expected data has been transferred from Amazon S3 to Object Cloud Storage.