GithubHelp home page GithubHelp logo

dynamodb-backup-json's Introduction

DynamoDB backup JSON

概要

  • DynamoDB のテーブルから Scan で取得したデータを JSON で書き出す
  • 書き出した JSON のデータを指定したテーブルにインポートする

準備

  • .env を修正する
    • DYNAMO_TABLE に取得/投入したいテーブル名を設定する
    • PROFILE に必要に応じて対象のテーブルにアクセス可能な AWS のプロファイルを設定する
      • default でよければそのままで
DYNAMO_TABLE=table_name
PROFILE=my-profile
  • ライブラリのインストール
yarn

エクスポート

yarn start
  • 実行結果が results 配下に生成される
% tree results
results
├── table_name-2021-04-05T16:21:08.402Z.json
├── table_name-2021-04-05T16:16:47.024Z.json
├── table_name-2021-04-05T16:18:51.486Z.json
├── table_name-2021-04-05T16:27:46.992Z.json
└── table_name-2021-04-05T16:31:15.827Z.json
  • JSONファイルを Prettier でフォーマットしているが不要な場合は以下のコマンドでエクスポートのみできる
    • データ量が多いとフォーマットも時間がかかるのでスキップした方が速い
yarn invoke:export

インポート

  • インポートしたいデータの入ったファイルを results/data.json に配置する
  • 以下のコマンドでデータを投入できる
yarn invoke:import

dynamodb-backup-json's People

Contributors

ozaki25 avatar bamiyanapp avatar kazuma-tachi avatar

Watchers

James Cloos avatar  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.