Skip to main content

PyPI version

Python CLI to make a backup of an entire CartoDB domain to SQL dump file (zipped).

Optional:

  • You can restore SQL dumped file to a new (created) PostGIS DB.

  • You can upload sql files to Amazon S3.

  • Message from Amazon SNS (Simple Notification Service).

Before execute this script you need a cartodbbkconfig.py file properly formed (See cartodbbkconfig_example.py).

cartodbbkconfig.py config parameters:

confparams = {
                "cdb_apikey": "here your api key",
                "cdb_domain": "here your domain",
                "sql_folderpath": "here your dump folderpath",
                "pg_user": "here your db admin user",
                "pg_pswd": None, # If you leave the password to None, the program will ask you in the command line interface
                "pg_dbase": "here your db name",
                "pg_host": "here your db host",
                "pg_port": "here your db port",
                "pg_newdatabase": "here your new db name",
                "aws_acckey": "here your AWS Acces Key",
                "aws_seckey": "here your AWS Secret Key",
                "aws_bucket": "here your AWS bucket",
                "aws_prekey": "here your AWS bucket prefix key",
                "sns_regname": "here your AWS region name",
                "sns_arn": "here your SNS ARN",
                "sns_subject": "My project"
            }

Installation

You can install this package from PYPI: https://pypi.python.org/pypi/cartodb_backup

$ pip install cartodb_backup

You can also install it in this way:

$ python setup.py install

Usage

Python CLI:

$ cartodb_backup [-h] configfile [--postgis_backup] [--aws_s3upload]
                 [--amz_sns] [--rmv_localfl]

positional arguments:
  configfile            Config filepath: /folderlocation/

optional arguments:
  -h, --help            show this help message and exit
  --postgis_backup      POSTGIS_BACKUP PostGIS backup (restoring dump file created)
  --aws_s3upload        Upload file to Amazon S3
  --amz_sns             Amazon SNS message
  --rmv_localfl         Remove local file after a successfully Amazon S3 upload

Example without PostGIS backup:

$ cartodb_backup /folderlocation/

Example with PostGIS backup:

$ cartodb_backup /folderlocation/ --postgis_backup

Example with Amazon S3 upload:

$ cartodb_backup /folderlocation/ --aws_s3upload

Example with Amazon S3 upload and Amazon SNS (removing local sql folder after upload):

$ cartodb_backup /folderlocation/ --aws_s3upload --amz_sns --rmv_localfl

Requirements

  • GDAL >= 1.11.

  • PostgreSQL with PostGIS (1).

  • Psycopg2 Python library (1).

  • Python interface to Amazon Web Services (Boto) (2).

  1. Only if you want to use –postgis_backup parameter.

  2. Only if you want to use –aws_s3upload parameter.

About author

Developed by Cayetano Benavent. GIS Analyst at Geographica.

http://www.geographica.gs

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Metadata

Release files for cartodb_backup 0.1

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

Source distribution (sdist)

Source distribution for cartodb_backup 0.1
File Size Uploaded Provenance
cartodb_backup-0.1.tar.gz 6.5 kB Without provenance Details

Release files / cartodb_backup-0.1.tar.gz

Download URL cartodb_backup-0.1.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c30ce98ff7f502d776a42361dbf2c5e95e4f1d32c40bb39f9ad5dca228306593
BLAKE2b-256 checksum
How to use checksums
7cdcdcb989a7ffb1718bdb72eb4c20aac98ccb274ce901e5042f14d0ddb7b523
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for cartodb_backup 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file No provenance

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