# db sync tool
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/db_sync_tool-kmi)
![PyPI](https://img.shields.io/pypi/v/db_sync_tool-kmi)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/jackd248/db-sync-tool/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/jackd248/db-sync-tool/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/jackd248/db-sync-tool/badges/build.png?b=master)](https://scrutinizer-ci.com/g/jackd248/db-sync-tool/build-status/master)
Python script to synchronize a database from an origin to a target system with automatic database credential extraction depending on the selected framework.
## Features
- __Database sync__ from and to a remote system
- __Proxy mode__ between two remote systems
- Automatic database __credential extraction__ using a supported framework
- [TYPO3](https://typo3.org/) (>= v7.6)
- [Symfony](https://symfony.com/) (>= v2.8)
- [Drupal](https://www.drupal.org/) (>= v8.0)
- [Wordpress](https://wordpress.org) (>= v5.0)
- [Laravel](https://laravel.com/) (>= v4.0)
- Easily dump creation (database __backup__)
- __Cleanup__ feature for backups
- Extended __logging__ capabilities
- Many more possibilities for __customization__
## Installation
### Prerequisite
The script needs [python](https://python.org/) __3.5__ or higher. It is necessary for some additional functionalities to have [pip](https://pypi.org/project/pip/) installed on your local machine.
<a name="install-pip"></a>
### pip
The library can be installed from [PyPI](https://pypi.org/project/db-sync-tool-kmi/):
```bash
$ pip3 install db-sync-tool-kmi
```
<a name="install-composer"></a>
### composer
While using the script within the PHP framework context, the script is available via [packagist.org](https://packagist.org/packages/kmi/db-sync-tool) using composer:
```bash
$ composer require kmi/db-sync-tool
```
Additionally install the python requirements via the following pip command:
````bash
$ pip3 install -e vendor/kmi/db-sync-tool/
````
## Quickstart
Detailed instructions for:
- [Manual database sync](docs/quickstart/START.md)
- [TYPO3 database sync](docs/quickstart/TYPO3.md)
- [Symfony database sync](docs/quickstart/SYMFONY.md)
- [Drupal database sync](docs/quickstart/DRUPAL.md)
- [Wordpress database sync](docs/quickstart/WORDPRESS.md)
If you want to have an inside in more configuration examples, see the [test scenarios](tests/scenario).
## Usage
### Command line
Run the python script via command line.
Installed via [pip](#install-pip):
```bash
$ db_sync_tool
```
Installed via [composer](#install-composer):
```bash
$ python3 vendor/kmi/db-sync-tool/db_sync_tool
```
![Example receiver](docs/images/db-sync-tool-example-receiver.gif)
<a name="shell-arguments"></a>
#### Shell arguments
```bash
usage: db_sync_tool [-h] [-f CONFIG_FILE] [-v] [-y] [-m] [-dr]
[-i IMPORT_FILE] [-dn DUMP_NAME] [-kd KEEP_DUMP]
[-o HOST_FILE] [-l LOG_FILE] [-cd] [-t TYPE]
[-tp TARGET_PATH] [-tn TARGET_NAME] [-th TARGET_HOST]
[-tu TARGET_USER] [-tpw TARGET_PASSWORD] [-tk TARGET_KEY]
[-tpo TARGET_PORT] [-tdd TARGET_DUMP_DIR]
[-tkd TARGET_KEEP_DUMPS] [-tdn TARGET_DB_NAME]
[-tdh TARGET_DB_HOST] [-tdu TARGET_DB_USER]
[-tdpw TARGET_DB_PASSWORD] [-tdpo TARGET_DB_PORT]
[-tad TARGET_AFTER_DUMP] [-op ORIGIN_PATH]
[-on ORIGIN_NAME] [-oh ORIGIN_HOST] [-ou ORIGIN_USER]
[-opw ORIGIN_PASSWORD] [-ok ORIGIN_KEY] [-opo ORIGIN_PORT]
[-odd ORIGIN_DUMP_DIR] [-okd ORIGIN_KEEP_DUMPS]
[-odn ORIGIN_DB_NAME] [-odh ORIGIN_DB_HOST]
[-odu ORIGIN_DB_USER] [-odpw ORIGIN_DB_PASSWORD]
[-odpo ORIGIN_DB_PORT]
A tool for automatic database synchronization from and to host systems.
optional arguments:
-h, --help show this help message and exit
-f CONFIG_FILE, --config-file CONFIG_FILE
Path to configuration file
-v, --verbose Enable extended console output
-y, --yes Skipping user confirmation for database import
-m, --mute Mute console output
-dr, --dry-run Testing process without running database export,
transfer or import.
-i IMPORT_FILE, --import-file IMPORT_FILE
Import database from a specific file dump
-dn DUMP_NAME, --dump-name DUMP_NAME
Set a specific dump file name (default is
"_[dbname]_[date]")
-kd KEEP_DUMP, --keep-dump KEEP_DUMP
Skipping target import of the database dump and saving
the available dump file in the given directory
-o HOST_FILE, --host-file HOST_FILE
Using an additional hosts file for merging hosts
information with the configuration file
-l LOG_FILE, --log-file LOG_FILE
File path for creating a additional log file
-cd, --clear-database
Dropping all tables before importing a new sync to get
a clean database.
-t TYPE, --type TYPE Defining the framework type [TYPO3, Symfony, Drupal,
Wordpress]
-tp TARGET_PATH, --target-path TARGET_PATH
File path to target database credential file depending
on the framework type
-tn TARGET_NAME, --target-name TARGET_NAME
Providing a name for the target system
-th TARGET_HOST, --target-host TARGET_HOST
SSH host to target system
-tu TARGET_USER, --target-user TARGET_USER
SSH user for target system
-tpw TARGET_PASSWORD, --target-password TARGET_PASSWORD
SSH password for target system
-tk TARGET_KEY, --target-key TARGET_KEY
File path to SSH key for target system
-tpo TARGET_PORT, --target-port TARGET_PORT
SSH port for target system
-tdd TARGET_DUMP_DIR, --target-dump-dir TARGET_DUMP_DIR
Directory path for database dump file on target system
-tkd TARGET_KEEP_DUMPS, --target-keep-dumps TARGET_KEEP_DUMPS
Keep dump file count for target system
-tdn TARGET_DB_NAME, --target-db-name TARGET_DB_NAME
Database name for target system
-tdh TARGET_DB_HOST, --target-db-host TARGET_DB_HOST
Database host for target system
-tdu TARGET_DB_USER, --target-db-user TARGET_DB_USER
Database user for target system
-tdpw TARGET_DB_PASSWORD, --target-db-password TARGET_DB_PASSWORD
Database password for target system
-tdpo TARGET_DB_PORT, --target-db-port TARGET_DB_PORT
Database port for target system
-tad TARGET_AFTER_DUMP, --target-after-dump TARGET_AFTER_DUMP
Additional dump file to insert after the regular
database import
-op ORIGIN_PATH, --origin-path ORIGIN_PATH
File path to origin database credential file depending
on the framework type
-on ORIGIN_NAME, --origin-name ORIGIN_NAME
Providing a name for the origin system
-oh ORIGIN_HOST, --origin-host ORIGIN_HOST
SSH host to origin system
-ou ORIGIN_USER, --origin-user ORIGIN_USER
SSH user for origin system
-opw ORIGIN_PASSWORD, --origin-password ORIGIN_PASSWORD
SSH password for origin system
-ok ORIGIN_KEY, --origin-key ORIGIN_KEY
File path to SSH key for origin system
-opo ORIGIN_PORT, --origin-port ORIGIN_PORT
SSH port for origin system
-odd
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共37个文件
py:28个
txt:5个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:db_sync_tool-kmi-2.5.0.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
db_sync_tool-kmi-2.5.0.tar.gz (37个子文件)
db_sync_tool-kmi-2.5.0
PKG-INFO 13KB
db_sync_tool
recipes
typo3.py 1KB
wordpress.py 1KB
laravel.py 1KB
symfony.py 3KB
__init__.py 0B
drupal.py 1KB
database
utility.py 5KB
__init__.py 0B
process.py 6KB
__main__.py 13KB
__init__.py 0B
info.py 100B
utility
helper.py 7KB
parser.py 6KB
mode.py 8KB
__init__.py 0B
validation.py 3KB
system.py 11KB
info.py 2KB
log.py 869B
output.py 4KB
remote
client.py 3KB
utility.py 3KB
__init__.py 0B
system.py 1KB
transfer.py 4KB
sync.py 2KB
db_sync_tool_kmi.egg-info
PKG-INFO 13KB
requires.txt 69B
SOURCES.txt 1KB
entry_points.txt 61B
top_level.txt 13B
dependency_links.txt 1B
setup.cfg 38B
setup.py 1KB
README.md 10KB
共 37 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功