Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/markshust/syncdb
sycndb is a shell script that takes a mysqldump of a remote database, zips it up, copies it to your localhost, unzips it and loads it into a local database.
https://github.com/markshust/syncdb
Last synced: 2 days ago
JSON representation
sycndb is a shell script that takes a mysqldump of a remote database, zips it up, copies it to your localhost, unzips it and loads it into a local database.
- Host: GitHub
- URL: https://github.com/markshust/syncdb
- Owner: markshust
- Created: 2015-01-20T04:54:11.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-20T15:57:47.000Z (almost 10 years ago)
- Last Synced: 2024-05-02T00:48:02.528Z (6 months ago)
- Language: Shell
- Size: 139 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
syncdb
======syncdb is a shell script that takes a mysqldump of a remote database, zips it up, copies it to your localhost, unzips it and loads it into a local database. If you run Magento, it'll also update the `core_config_data` table to your local URL.
Usage
-----Set the proper permissions on this file, update the config variables and run:
```
./syncdb.sh
```Example of output when running script:
```
$ ./syncdb.sh
host
Creating zipped backup of remote database
Transferring backup from remote to local
host
database.tmp.sql.tar.gz 100% 128KB 128.0KB/s 00:01
host
Unzipping mysql backup
Reloading local database (may take few moments)
Updating config
Complete!
```This script assumes that you have SSH Keys setup for connecting to your remote host. If you do not, you'll need to modify the script as necessary.
NOTE: If you are not running a Magento store, you don't need to define `LOCAL_BASE_URL` and can remove lines 11, 30, & 31.
Options
-------- `REMOTE_HOST`: The SSH info for your remote host. Ex: `user@host`
- `REMOTE_MYSQL_HOST`: MySQL server hostname for your remote host.
- `REMOTE_MYSQL_DB`: MySQL database name for your remote host.
- `REMOTE_MYSQL_USER`: MySQL username for your remote host.
- `REMOTE_MYSQL_PASS`: MySQL password for your remote host.
- `LOCAL_MYSQL_HOST`: MySQL server hostname for your local host.
- `LOCAL_MYSQL_DB`: MySQL database name for your local host.
- `LOCAL_MYSQL_USER`: MySQL username for your local host.
- `LOCAL_MYSQL_PASS`: MySQL password for your local host.
- `LOCAL_BASE_URL`: Local URL for your Magento instance (ensure trailing slash). Ex. `http://domain.local/`