Skip to main content

mongo-dump

Codacy Badge DeepSource release Actions Status build Actions Status PyPI Version Docker Image Size

Backup utility for MongoDB. Compatible with Azure, Amazon Web Services and Google Cloud Platform.

Installation

Make sure that original MongoDB Database Tools are installed. Please follow instruction on the official page for platform specific installation. Also make sure that mongodump command is in your PATH.

pip install mongodump-s3

Usage

mongodump-s3 could be used as command line tool or as Docker service. There are also three possible ways to pass parameters to the utility:

  • Through setting environment variables
  • By passing env file to the tool
  • Or by passing individual flags

Please refer to sample.env example for all possible env options.

Command line

$ mongodump-s3 --help
usage: mongodump-s3 <options>

Export the content of a running server into .bson files and uploads to provided S3 compatible storage. By default loads required settings from environment variables.

general options:
  -h, --help            print usage
  -v, --version         print the tool version and exit

output options:
  -b <S3 Bucket>, --bucket <S3 Bucket>
                        S3 bucket name for upload, defaults to 'mongodump'
  -o <folder>, --out <folder>
                        output directory, defaults to 'dump'

uri options:
  -u <uri>, --uri <uri>
                        mongodb uri connection string. See official description here https://docs.mongodb.com/manual/reference/connection-string

environmental options:
  -e <env-file>, --env <env-file>
                        path to file containing environmental variables

cloud storage options:
  --azure "<azure_storage_connection_string>"
                        connection string for storage account provided by Azure
  --aws "<aws_access_key_id=value> <aws_secret_access_key=value> <aws_region=value>"
                        AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION properties provided by Amazon Web Services IAM. AWS_REGION defaults to 'us-west-2' if not specified
  --gcp "<google_application_credentials=value> <google_region=value>"
                        path to service account file and optional Google Cloud Region. GOOGLE_REGION defaults to 'us-multiregion' if not specified

notification options:
  --email <user@example.com>
                        email address which to notify upon the result
  --smtp <mail-server.example.com>
                        SMTP relay server to use, defaults to 'localhost'
  --telegram "<telegram_token=value> <telegram_chat_id=value>"
                        Telegram API token and chat id to be used for notification. See more: https://core.telegram.org/bots/api

Docker

sudo docker run --name mongo-dump [Optional: --env-file sample.env] exesse/mongodump-s3:latest [Optional: startup flags]

In case you need to pass GCP service account key please mount the key inside container and simply specify GOOGLE_APPLICATION_CREDENTIALS=/mongo-dump/key.json.

sudo docker run --name mongodump-gcp \
    --env-file sample.env \
    -v ~/dev.json:/mongodump/key.json:ro \
    exesse/mongodump-s3:latest 

Feedback

Email bug reports, questions, discussions to hi@exesse.org.

Metadata

Release files for mongodump-s3 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mongodump-s3 1.1.2
File Size Uploaded
mongodump-s3-1.1.2.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mongodump-s3 1.1.2
File Interpreter ABI Platform
mongodump_s3-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 27.2 kB

Release files / mongodump-s3-1.1.2.tar.gz

Download URL mongodump-s3-1.1.2.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
84b13a93547343738a75349aa2d264e379bbbd46c1c666968b9fedb92145c56f
BLAKE2b-256 checksum
How to use checksums
1649a7e4c10e045855045c2b459f3775418a27f9e3b020c3f128ceea7ffcce9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.3

Release files / mongodump_s3-1.1.2-py3-none-any.whl

Download URL mongodump_s3-1.1.2-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5cd7d8f63d074a375082f1dd25117a63fc9011db322b38cb9c6d03255dcfb73
BLAKE2b-256 checksum
How to use checksums
cc68193426aa673a4c0a035f641e597ac77ca9ab88d50a5293fb00b32fffe6b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.3

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page