add column name as bucket folder in aws dms full-load task | source MySQL | target S3

0

i want to create a AWS DMS task which can migrate the data from Source:- MySQL Target:- S3 Bucket:- test Bucket folder:- /days=19700/data/.parquet /days=19701/data/.parquet the days value here is the value from one of the column in source MySQL and i need to do this in AWS DMS full-load task

1 Answer
0

Hello,

AWS DMS doesn't directly support dynamic folder creation based on column values.

Try To do these:

  • Create a staging table in MySQL with a 'days' column.
  • Configure DMS to extract from this table.
  • Use a custom script to read data from S3, create folders based on 'days', and move data accordingly.
  • Key points: Consider performance, error handling, and S3 bucket permissions.

EX: Create a Staging Table in MySQL

CREATE TABLE staging_table (
  column1 INT,
  column2 VARCHAR(255),
  -- other columns
  days INT
);

Populate the Staging Table

INSERT INTO staging_table (column1, column2, ...)
SELECT column1, column2, ...
FROM your_source_table;

Create an AWS DMS Task

  • Configure the DMS task to extract data from the staging_table.
  • Set the target S3 bucket and a generic folder structure (e.g., data/).
profile picture
EXPERT
answered 10 months ago
profile picture
EXPERT
reviewed 10 months ago
  • so this staging table should be created as staging_table_19700, staging_table_19701 and data needs to be migrated using different dms task as the target folder is not same?

  • Noo , Nooo

    Creating multiple staging tables and DMS tasks for each day is not efficient and increases complexity. For that do alternatives like:

    1. Create a staging table in your MySQL database with a 'days' column.
    2. Use a single DMS task to load data from the staging table into a single S3 folder.
    3. Develop a script to read data from S3, create folders based on the 'days' column, and move data accordingly.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions