Coder Social home page Coder Social logo

dumpimp's Introduction

dumpimp
========

Rake tasks to dump and import various database batch files. (currently only MySQL, but feel free to add additional)

  db:dump
  =====================
  Description: Dump database file and gzip for RAILS_ENV.  Initial path of dump is to "db/".  Set alternate path with INITIAL_PATH=path/to/dump/.  To skip gzip use GZIP=no.
  
  Options:
    INITIAL_PATH=/my/db/dump/path/  (defaults to db/)
    GZIP=yes|no (defaults to yes)
    RAILS_ENV=production|development|test (default is development)

  Examples:
    rake db:dump
      - dumps development database to file in db/ folder
      - then gzips the file so you're left with "env_database_name_dump.sql.gz"
  
    rake db:dump INITIAL_PATH=.
      - same as above except dumps into root of your application instead of db/
  
    rake db:dump GZIP=no RAILS_ENV=production
      - dumps production database to sql file in db/ folder
      - does not gzip the file

  

  db:import (or db:imp)
  =====================
  Description: Import database dump file into the specified RAILS_ENV.  Select file with FILE=path/to/file.  If the file is gzipped, it will be unzipped, imported and then gzipped back again.

  Requirements:
    FILE=path/to/file
  
  Options:
    RAILS_ENV=production|development|test - the environment database that the dump file is loaded into (defaults to development)

  Examples:
    rake db:import FILE=db/development_db_name_dump.sql.gz RAILS_ENV=production
      - first gunzips "development_db_name_dump.sql.gz"
      - then imports sql file into "production_db_name" database
      - finally gzips the file back up for the next usage
      
    rake db:import FILE=db/development_db_name_dump.sql RAILS_ENV=test
      - imports sql file into "test_db_name" database
      - no gunzip or gzip takes place unless given a .gz file
      

Copyright (c) 2008 Elijah Miller / David Baldwin, released under the MIT license

dumpimp's People

Contributors

baldwindavid avatar harking avatar

Stargazers

Hadj H. avatar Angus H. avatar  avatar Irina Dumitrascu avatar Jérémy Lecour avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

harking

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.