Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dpb587/mysql-archive-bosh-release
To create a backup from a MySQL database and restore it later.
https://github.com/dpb587/mysql-archive-bosh-release
Last synced: 24 days ago
JSON representation
To create a backup from a MySQL database and restore it later.
- Host: GitHub
- URL: https://github.com/dpb587/mysql-archive-bosh-release
- Owner: dpb587
- License: mit
- Created: 2016-11-13T07:33:45.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-02T17:03:25.000Z (about 8 years ago)
- Last Synced: 2024-10-30T18:13:23.288Z (2 months ago)
- Language: Shell
- Size: 14.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mysql-archive-bosh-release
To create a backup from a MySQL database and restore it later.
## Usage
### Backup
To prepare for a backup, configure the [`mysql-backup`](jobs/mysql-backup/spec) job with `mysql` and `storage` links, as well as the `database` and `storage_bucket` properties...
jobs:
- name: "mysql-backup"
release: "mysql-archive"
consumes:
mysql: { from: "mysql", deployment: "mysql" }
storage: { from: "storage", deployment: "storage" }
properties:
database: "wordpress"
storage_bucket: "my-wordpress-backups"Configure the instance as an `errand` or `service`. As an `errand`, invoke it like normal...
$ bosh run-errand backup-database
As a `service`, invoke it manually (it will not run on its own)...
$ bosh ssh -c /var/vcap/jobs/mysql-backup/bin/run database/0
Or colocate with and configure the [`mysql-backup-scheduler`](jobs/mysql-backup-scheduler) with a `schedule` property...
jobs:
- name: "mysql-backup"
...snip...
- name: "mysql-backup-scheduler"
release: "mysql-archive"
properties:
schedule: "0 1 * * *"Once completed, a compressed file might be available at...
https://backup.storage.internal/my-wordpress-backups/backup-20161101T010004Z.sql.xz.gpg
### Restore
To prepare for a restore, configure the [`mysql-restore`](jobs/mysql-restore/spec) job with `mysql` and `storage` links, as well as the `database` and `storage_bucket` property...
jobs:
- name: "mysql-restore"
release: "mysql-archive"
consumes:
mysql: { from: "mysql", deployment: "mysql" }
storage: { from: "storage", deployment: "storage" }
properties:
database: "wordpress"
storage_bucket: "my-wordpress-backups"Configure the instance as an `errand` and run it like normal...
$ bosh run-errand restore-database
### Encryption
Use the `public_key` property of `mysql-backup` to encrypt backups with `gpg`, and use the `private_key` property of `mysql-restore` to decrypt backups.
## License
[MIT License](./LICENSE)