Git Product home page Git Product logo

docker-pgcopy's Introduction

PostgreSQL Copy

Image that runs a container for copying a database from one server to another.

Environment Variables

Both SOURCE_* and TARGET_* variables must be defined for the following parameters.

  • HOST
  • PORT
  • USER
  • PASS
  • DB

Usage

The most concise way is to create an environment file, such as pgcopy.vars:

SOURCE_HOST=192.168.59.103
SOURCE_PORT=5433
SOURCE_DB=postgres
SOURCE_USER=postgres
TARGET_HOST=192.168.59.103
TARGET_PORT=5434
TARGET_DB=postgres
TARGET_USER=postgres

Then pass it to the docker run command. The target database will be automatically created if it does not exist.

docker run --env-file=pg.vars bruth/pgcopy

Any additional arguments passed to the command will be added to the pg_dump command for the source database. This provides flexibility for specifying more fine-grain options such as selecting specific schemata or tables to dump, dropping existing tables, or creating the database. For example, this command will clean all objects in the target database before copying the new data.

docker run --env-file=pg.vars bruth/pgcopy --clean --if-exists --schema=archive

See the full reference of pg_dump options: http://www.postgresql.org/docs/9.4/static/app-pgdump.html

docker-pgcopy's People

Contributors

bruth avatar

Stargazers

 avatar

Watchers

 avatar  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.