This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

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


  • 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 file properly formed (See 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"


You can install this package from PYPI:

$ pip install cartodb_backup

You can also install it in this way:

$ python install


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


  • 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.


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.

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
cartodb_backup-0.1.tar.gz (6.5 kB) Copy SHA256 Checksum SHA256 Source Nov 17, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting