Coder Social home page Coder Social logo

schumacherfm / syncdb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markshust/syncdb

3.0 3.0 1.0 93 KB

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.

Shell 100.00%

syncdb's Introduction

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/

syncdb's People

Contributors

schumacherfm avatar markshust avatar

Stargazers

Jared avatar Roman Hutterer avatar Sergey Strelnikov avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.