CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Are any special switches needed to mysqldump in order to backup ALL of CiviCRM?
Pages: [1]

Author Topic: Are any special switches needed to mysqldump in order to backup ALL of CiviCRM?  (Read 763 times)

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Are any special switches needed to mysqldump in order to backup ALL of CiviCRM?
July 08, 2014, 12:04:49 pm
Greetings,

I came across this MySQL + InnoDB web page recently:

"MySQL Maintenance Tasks for InnoDB with MySQL 5.1"
http://www.laurencegellert.com/2011/07/mysql-maintenance-tasks-for-innodb-with-mysql-5-1/

I noticed some additional switches to mysqldump which I had not encountered before, namely: "--routines --triggers"

According to this page:

"Backup Data"
http://wiki.civicrm.org/confluence/display/CRMDOC/Backup+Data

I get the impression that it is assumed by the CiviCRM support community such mysqldump command line switches are not necessary, otherwise I would have expected a note of "be sure to include switch ..."

Asking here to be sure that nothing is being neglected to be backed up by NOT specifying additional mysqldump switches.

At this point, I am using this template syntax to backup databases:
Code: [Select]
/usr/bin/mysqldump -h $1 --default-character-set=utf8 -u $2 --password=$3 --opt --single-transaction $4 | /bin/bzip2 -9c > $BKFILE.bz2
I am thankful,
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Are any special switches needed to mysqldump in order to backup ALL of CiviCRM?
July 08, 2014, 01:45:55 pm
Hi Michael,

Is there a reason you don't pipe "drush civicrm-sql-dump" to bzip2?  I'm not saying it's better, I'm genuinely curious!

Jon
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Are any special switches needed to mysqldump in order to backup ALL of CiviCRM?
July 08, 2014, 02:30:33 pm
Greetings Jon,

Our MySQL backup Bash scripts predate the existence of Drush.

I have migrated to running CiviCRM cron jobs with Drush, however, when I upgraded from Civi 3.4.8 to 4.4.x recently.

So I suppose I could peek in the code to see how Drush does the Civi DB backup. Thank you for pointing that capability of Drush out to me.

I am thankful,
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Are any special switches needed to mysqldump in order to backup ALL of CiviCRM?
July 09, 2014, 03:20:55 am
Greetings again Jon,

Nothing too helpful found in the source code for Drush. See below:

Code: [Select]
$ grep -r civicrm-sql-dump *

$ grep -r mysqldump *
commands/sql/sql.drush.inc:    'description' => 'Exports the Drupal DB as SQL using mysqldump or equivalent.',
commands/sql/sql.drush.inc: * Command callback. Outputs the entire Drupal database in SQL format using mysqldump.
commands/sql/sql.drush.inc: * Build a mysqldump/pg_dump/sqlite statement.
commands/sql/sql.drush.inc: *     1. A mysqldump/pg_dump/sqlite statement that is ready for executing.
commands/sql/sql.drush.inc: * Build a mysqldump/pg_dump/sqlite statement.
commands/sql/sql.drush.inc: *     1. A mysqldump/pg_dump/sqlite statement that is ready for executing.
commands/sql/sql.drush.inc:      $exec = 'mysqldump';
commands/sql/sql.drush.inc:      // mysqldump wants 'databasename' instead of 'database=databasename' for no good reason.
commands/sql/sql.drush.inc:        // Run mysqldump again and append output if we need some structure only tables.
commands/sql/sql.drush.inc:          $exec .= " && mysqldump --no-data $extra " . implode(' ', $structure_tables);

My OP question remains.

I am thankful,
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Are any special switches needed to mysqldump in order to backup ALL of CiviCRM?

This forum was archived on 2017-11-26.