| Crates.io | arcula |
| lib.rs | arcula |
| version | 1.0.6 |
| created_at | 2025-05-17 16:28:59.312297+00 |
| updated_at | 2025-12-24 12:02:13.475826+00 |
| description | Arcula - MongoDB database synchronization tool |
| homepage | |
| repository | https://github.com/ggagosh/arcula |
| max_upload_size | |
| id | 1677977 |
| size | 137,861 |
From author: This project exists to help me with my development workflow. I often need to synchronize MongoDB databases between different environments (local, dev, staging, not production 🙈). Before, I used raw
mongodump/mongorestoreand relied on atuin ✨ (great tool btw) to switch between. This tool is a simple wrapper around these commands and with help of AI (Claude Code) it took max 2 hours to implement. Somehow for me it is much more convenient to use and maybe it will be useful for someone else too. 🙌
Arcula is a CLI application for synchronizing MongoDB databases between different environments. It allows you to easily export databases from one MongoDB instance and import them to another.
mongodump and mongorestore executables)# Clone the repository
git clone https://github.com/ggagosh/arcula.git
cd arcula
# Build the project
cargo build --release
# The binary will be available at target/release/arcula
# Run directly with cargo
cargo run -- [COMMAND] [OPTIONS]
Create a .env file in the root directory of the project with the following variables:
# MongoDB Connection URIs - You can add any environment you need
MONGO_LOCAL_URI=mongodb://localhost:27017
MONGO_DEV_URI=mongodb://user:password@dev.example.com:27017
MONGO_STG_URI=mongodb://user:password@stg.example.com:27017
MONGO_PROD_URI=mongodb://user:password@prod.example.com:27017
MONGO_RANDOM_URI=mongodb://user:password@random.example.com:27017
# Path to MongoDB binaries (optional, auto-detected if not specified)
MONGODB_BIN_PATH=/usr/local/bin
# Backup directory
BACKUP_DIR=./backups
# Logging level: trace, debug, info, warn, error
RUST_LOG=info
You can copy the sample.env file and modify it for your needs. The application will dynamically detect all MongoDB environments from environment variables following the pattern MONGO_<ENV>_URI.
cargo run -- info
This command will show all configured MongoDB environments and their databases.
Interactive mode (will prompt for missing options):
cargo run -- sync
With command-line options:
cargo run -- sync --from LOCAL --to DEV --db my_database --backup true
Options:
--from: Source environment (any configured environment)--to: Target environment (any configured environment)--db: Database to synchronize--target-db: Target database name (defaults to source database name)--backup: Whether to create a backup before import (true/false, defaults to true)--drop: Whether to drop collections during import (true/false, defaults to true)--clear: Whether to clear collections during import (true/false, defaults to false, ignored if drop is enabled)--interactive: Enable interactive prompts# Synchronize 'users' database from DEV to LOCAL environment with interactive prompts
cargo run -- sync --from DEV --to LOCAL --db users --interactive
# Synchronize 'products' database from PROD to STG environment without prompts
cargo run -- sync --from PROD --to STG --db products
# Synchronize 'analytics' database from RANDOM to DEV environment with custom target db
cargo run -- sync --from RANDOM --to DEV --db analytics --target-db analytics_copy
Contributions are welcome! Feel free to submit a pull request with your changes.
MIT