drupal-dump

Dump & compress a Drupal database

Usage no npm install needed!

<script type="module">
  import drupalDump from 'https://cdn.skypack.dev/drupal-dump';
</script>

README

drupal-dump

CLI tool to dump & compress a Drupal database

npm version

Installing

The lazy approach to installing this requires sudo (root) access:

  sudo npm install -g drupal-dump

Of course, I do not recommend installing npm packages with sudo unless it's required.

This is how I install CLI tools from npm (like drupal-dump) without sudo:

  1. perform these steps: https://gist.github.com/gavinengel/1842179837823dc25730
  2. cd ~/bin/_npm/
  3. npm install --save drupal-dump

Usage

  Usage: drupal-dump -u "dbuser" -p "dbpassword" -n "dbname"

    # Saves a gzip compressed SQL dump of Drupal database 
    # to: /home/gavin/tmp/dumps/<dbname>.sql.gz

  Dump & compress a Drupal database

  Options:

    -h, --help                 output usage information
    -V, --version              output the version number
    -u, --user <user>          MySQL username
    -p, --password <password>  MySQL password
    -n, --dbname <dbname>      MySQL database name
    -h, --host <host>          MySQL hostname/IP address
    -U, --sshuser <sshuser>    SSH username
    -i, --import               import compressed dump file from cache directory into database
    -d, --dryrun               perform a trial run and output debugging

Alternatives

These are alternative projects which can yield achieve a similar result:

License

(The MIT License) Copyright (c) 2015 Gavin Engel <gavin@engel.com>

See: http://opensource.org/licenses/MIT