Coder Social home page Coder Social logo

dynamodbcopy's Introduction

DynamoDB Table Copy Script

Overview

This Python script allows you to copy data from one DynamoDB table to another. It utilizes the Boto3 library, the AWS SDK for Python, to interact with DynamoDB.

WARNING: - Be cautious when running the script as it will overwrite existing data in the destination table.

NOTE: - Ensure that both the source and destination tables exist in your AWS account. NOTE: - Ensure that the IAM user or role associated with the AWS credentials used by the script has the necessary permissions to read from the source DynamoDB table and write to the destination DynamoDB table.

Prerequisites

  1. Python3 installed on your system.
  2. Boto3 library installed (pip install boto3).
  3. AWS credentials configured on your system with appropriate permissions to read from the source DynamoDB table and write to the destination DynamoDB table.

Exporting AWS Environment Variables

Before running the script, you need to export your AWS credentials as environment variables. You can do this using the following commands:

export AWS_ACCESS_KEY_ID=<your_access_key_id>
export AWS_SECRET_ACCESS_KEY=<your_secret_access_key>
export AWS_DEFAULT_REGION=<your_aws_region>

or

export AWS_PROFILE=<your_profile_name>
export AWS_DEFAULT_REGION=<your_aws_region>

Usage

  1. Clone or download the script to your local machine.

  2. Open a terminal or command prompt.

  3. Navigate to the directory where the script is located.

  4. Run the script using the following command:

    python DynamoDBcopy.py <source_table_name> <destination_table_name>

    Replace <source_table_name> and <destination_table_name> with the names of your source and destination DynamoDB tables respectively.

  5. Once executed, the script will copy all data from the source table to the destination table.

Example

Suppose you have two DynamoDB tables named source_table and destination_table, and you want to copy data from source_table to destination_table. You would run the script as follows:

python DynamoDBcopy.py source_table destination_table

dynamodbcopy's People

Contributors

martinventx avatar

Watchers

Hans-Jörg Wieland avatar Raphael avatar Florian Beier avatar Boris Girsch avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.