This is a simple application that allows you to migrate files from an S3 bucket to a Cloudflare R2 bucket. Migration is done using the pnpm
command to ensure efficiency and ease of use.
Before getting started, make sure you have the following prerequisites installed on your system:
- Node.js: Download
- pnpm: Installation
-
Clone this repository to your local environment:
git clone https://github.com/andreghisleni/s3-to-cloudflare-r2-migrator.git
-
Navigate to the project directory:
cd s3-to-cloudflare-r2-migrator
-
Install the dependencies using pnpm:
pnpm install
-
Configure your S3 and Cloudflare R2 credentials:
Open the
.env
file and configure the following environment variables:AWS_ACCESS_KEY_ID=your-access-key AWS_SECRET_ACCESS_KEY=your-secret-key CLOUDFLARE_ACCOUNT_ID=your-cloudflare-account-id CLOUDFLARE_ACCESS_KEY=your-cloudflare-access-key CLOUDFLARE_SECRET_KEY=your-cloudflare-secret-key BUCKET_NAME=your-bucket-name
Be sure to replace the values above with your own.
To start migrating files from the S3 bucket to the Cloudflare R2 bucket, run the following command:
pnpm run migrate
This will initiate the migration process and display progress information in the console.
If you wish to contribute to this project, please feel free to create pull requests or report issues in the Issues section.
This project is licensed under the MIT License. See the LICENSE file for more details.
Thank you for using our S3 to Cloudflare R2 file migrator! If you have any questions or need assistance, please don't hesitate to reach out.