This Node.js application is designed to help you back up files from one Firebase Storage to another. It's built using TypeScript and can be easily run within a Docker container.
Before you get started, make sure you have the following:
- Node.js and npm installed
- Docker and Docker Compose installed (if you plan to use Docker)
- Firebase project details for both the source (ORIGIN) and destination (DESTINY) Firebase Storage instances.
You need to set the following environment variables in a .env
file or your system environment for the application to work correctly:
ORIGIN_API_KEY
: Your source Firebase API KeyORIGIN_AUTH_DOMAIN
: Your source Firebase Authentication DomainORIGIN_PROJECT_ID
: Your source Firebase Project IDORIGIN_STORAGE_BUCKET
: Your source Firebase Storage BucketORIGIN_MESSAGING_SENDER_ID
: Your source Firebase Messaging Sender IDORIGIN_APP_ID
: Your source Firebase App ID
DESTINY_API_KEY
: Your destination Firebase API KeyDESTINY_AUTH_DOMAIN
: Your destination Firebase Authentication DomainDESTINY_PROJECT_ID
: Your destination Firebase Project IDDESTINY_STORAGE_BUCKET
: Your destination Firebase Storage BucketDESTINY_MESSAGING_SENDER_ID
: Your destination Firebase Messaging Sender IDDESTINY_APP_ID
: Your destination Firebase App ID
If you want to build the application manually, you can run the following command:
npm run build
If you prefer to run the application within a Docker container, you can follow these steps:
Build the Docker image with the provided Dockerfile:
docker build -t firebase-storage-backup -f Dockerfile .
Or run the application using Docker Compose:
docker-compose up
Once the application is set up, it will copy files from the source Firebase Storage to the destination Firebase Storage. You can customize the backup process by modifying the TypeScript code according to your specific requirements.
This project is licensed under the ISC License - see the LICENSE file for details.
Thanks to the Firebase team for providing a reliable cloud storage solution.