1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

How do you backup Expand

Discussion in 'Plesk Expand 2.0 and Legacy General Discussion' started by eugenevdm, Dec 18, 2006.

  1. eugenevdm

    eugenevdm Silver Pleskian

    30
    68%
    Joined:
    Nov 11, 2003
    Messages:
    611
    Likes Received:
    0
    Please could I have some tips for backing up Expand?
     
  2. CryoGenID

    CryoGenID Regular Pleskian

    25
    90%
    Joined:
    Apr 14, 2004
    Messages:
    150
    Likes Received:
    0
    Sure ;-)

    Just backup expand.conf, expand.key and the database.

    That's all you need to do... :)
     
  3. regx

    regx Guest

    0
     
    I'd like to share a shell script making Expand DB backups a bit simpler:

    PHP:
    #!/bin/bash

    LOGIN="expand"
    PASSWORD=`cat /usr/local/expand/etc/.expand.shadow`

    MYSQLDUMP="mysqldump -u$LOGIN -p$PASSWORD -Q --add-drop-table"
    EXPAND_DB="expand"

    echo "SET FOREIGN_KEY_CHECKS=0;"

    for table in `mysql -u$LOGIN -p$PASSWORD $EXPAND_DB -Bs -e 'show tables'`; do
            case 
    $table in
                    tm_task
    )   $MYSQLDUMP '--where=period>0' $EXPAND_DB "$table";;
                    
    tm_action$MYSQLDUMP --no-data $EXPAND_DB "$table";;
                    *)         
    $MYSQLDUMP $EXPAND_DB "$table";;
            
    esac
    done
    The script produces an SQL dump of Expand's DB to your shell console STDOUT.

    The script benefits are:
    + backups are made faster
    + when restoring DB there will be no errors on referential integrity

    And the problems are
    - history of actions performed before a backup is lost
     
Loading...