DataExporter

Use to export and import MySQL databases to S3.

To export a MySQL database:

  1. Add gem to Gemfile
  2. Create a YAML or ERB configuration that data-exporter can read:

    export_dir: '/tmp'
    backup_dir: '/backups'
    backup_key: 'config/backup_key' # openssl encryption key file
    mysql:
    adapter: 'mysql2'
    host: 'localhost'
    database: 'centurion_development'
    username: 'root'
    password: ''
    s3:
    access_key_id: 'ACCESS_KEY_ID'
    secret_access_key: 'SECRET_ACESS_KEY'
    bucket_name: 'socialcast_backups'
    prefix: 'centurion_development'
    
  3. Execute:

    bundle exec data-exporter export -f etc/data_exporter.yml --csv
    

To import a MySQL database as a directory of CSV files:

bundle exec data-exporter unpack -f etc/data_exporter.yml --csv

To import a MySQL database backup via --sftp:

bundle exec data-exporter unpack -f etc/data_exporter.yml --csv --sftp