DataExporter
Use to export and import MySQL databases to S3.
To export a MySQL database:
- Add gem to Gemfile
- Create a YAML or ERB configuration that
data-exporter
can read:
export_dir: '/tmp'
backup_dir: '/backups'
backup_key: 'config/backup_key'
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'
- 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