Skip to content

sebps/cloud-bucket-migrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloud-bucket-migrator

A lightweight library to migrate cloud buckets. It includes : upload a local directory to a remote cloud bucket, download a bucket to a local directory or transfer an origin bucket to a target bucket.

Features

  • Download a bucket
  • Upload a local directory to a bucket
  • Migrate a bucket ( Cross-Account supported )

Support

Currently only AWS S3 buckets operations are supported.

Installation

$ npm install cloud-bucket-migrator

Loading the module

const cloudBucketMigrator = require('cloud-bucket-migrator');

Common Usage

Download bucket

const path = 'LOCAL_PATH'; 
const platform = 'AWS_S3';
const bucketName = 'ORIGIN_BUCKET_NAME';
const credentials = {
    accessKey: 'ACCESS_KEY',
    secretKey:  'SECRET_KEY'
}

(async function() {
    await cloudBucketMigrator.downloadBucket(platform, credentials, bucketName, path);
})();

Upload bucket

const path = 'LOCAL_PATH'; 
const platform = 'AWS_S3';
const bucketName = 'TARGET_BUCKET_NAME';
const credentials = {
    accessKey: 'ACCESS_KEY',
    secretKey:  'SECRET_KEY'
}

(async function() {
    await cloudBucketMigrator.uploadBucket(platform, credentials, bucketName, path);
})()

Migrate bucket

const originPlatform = 'AWS_S3';
const originBucketName = 'ORIGIN_BUCKET_NAME';
const originCredentials = {
    accessKey: 'ORIGIN_ACCESS_KEY',
    secretKey:  'ORIGIN_SECRET_KEY'
}

const targetPlatform = 'AWS_S3';
const targetBucketName = 'TARGET_BUCKET_NAME';
const targetCredentials = {
    accessKey: 'TARGET_ACCESS_KEY',
    secretKey:  'TARGET_SECRET_KEY'
}

(async function() {
    await cloudBucketMigrator.migrateBucket(originPlatform, credentials, originBucketName, targetPlatform, credentials, targetBucketName);       
})();

License

MIT

About

A lightweight library to migrate cloud buckets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published