https://github.com/webarchitect609/mysql-twin-dump
Dumps an entire MySQL database to a single *.sql or *.sql.bz2 file, ignoring contents for specific set of tables
https://github.com/webarchitect609/mysql-twin-dump
mysqldump
Last synced: about 1 year ago
JSON representation
Dumps an entire MySQL database to a single *.sql or *.sql.bz2 file, ignoring contents for specific set of tables
- Host: GitHub
- URL: https://github.com/webarchitect609/mysql-twin-dump
- Owner: webarchitect609
- License: bsd-3-clause
- Created: 2020-07-10T11:09:10.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-31T15:10:44.000Z (over 2 years ago)
- Last Synced: 2024-01-31T16:54:18.480Z (over 2 years ago)
- Topics: mysqldump
- Language: Shell
- Homepage:
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
MySQL Twin Dump
===============
[](https://travis-ci.org/webarchitect609/mysql-twin-dump)
[](https://github.com/webarchitect609/mysql-twin-dump/releases)
[](LICENSE.md)
[перевести на русский](./README_ru.md)
**Please, be careful:** this is beta-version so far and things can change.
Dumps an entire MySQL database to a single `*.sql` or `*.sql.bz2` file, ignoring contents for specific set of tables.
It's intended to reduce the MySQL dump file size when it's known that some tables have insignificant data, but must
present in the database for normal operation mode.
Features
--------
- Runs `mysqldump` twice using `--no-data` or `--ignore-table` options to exclude content of specified set of tables,
but gets an entire database dump as single file
- Supports Bzip2 compression
- Dry-run mode lets you review all the actual commands that would be executed in the normal mode
Requirements
------------
- `mysqldump`
- `bzip2`
Installation
------------
`git clone` this repo wherever you want
Support
-------
You can use this script totally for free, or you can appreciate the author for his work and support desire to make new
useful projects:
- [ЮMoney](https://sobe.ru/na/mysql_twin_dump)
Usage
-----
For example, if you want to dump `database` with bzip2 compression, but exclude content of tables `b_event_log`,
`b_event` and `b_perf_sql`
```shell script
./bin/mysqltwindump --exclude-content b_event_log \
--exclude-content b_event \
--exclude-content b_perf_sql \
--host "localhost" \
--port "3306" \
--user "user" \
--password "password" \
--database "database" \
--bzip2 \
> "mysql-twin-dump_$(date +%Y-%m-%d_%H-%M).sql.bz2"
```
Get all possible options and modes
```shell script
./bin/mysqltwindump --help
```
Known Issues
------------
None so far.
Licence & Author Information
----------------------------
[BSD-3-Clause](LICENSE.md)