ISPConfig Backup Script

Discussion in 'General' started by vaio1, Oct 22, 2009.

  1. vaio1

    vaio1 Member

    Hi guys,

    I have created this little script to backup all the important files. Have I forgot something?

    Code:
    echo "";
    echo "************************************";
    echo "       ISPCONFIG BACKUP";
    echo "************************************";
    echo "";
    
    echo "Wait a moment please...";
    
    echo "1. Make a backup of /var/spool/mail";
    /etc/init.d/postfix stop
    cd /var/spool
    tar -czf $ISPCONFIG/mail.tar.gz mail
    
    echo "2. Copy the passwd file";
    cp /etc/passwd $ISPCONFIG
    
    echo "3. Copy the shadow file";
    cp /etc/shadow $ISPCONFIG
    
    echo "4. Copy the group files";
    cp /etc/group $ISPCONFIG
    
    echo "5. Copy the Vhosts_ispconfig.conf file";
    cp /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf $ISPCONFIG
    
    echo "6. Copy the local-host-names file";
    cp /etc/postfix/local-host-names $ISPCONFIG
    
    echo "7. Copy the postfix/virtusertable file";
    cp /etc/postfix/virtusertable $ISPCONFIG
    
    echo "8. Copy the named.conf file";
    cp /var/named/chroot/etc/named.conf $ISPCONFIG
    
    echo "9. Copy the proftpd.conf file";
    cp /etc/proftpd.conf $ISPCONFIG
    
    echo "10. Copy the proftpd_ispconfig.conf file";
    cp /etc/proftpd_ispconfig.conf $ISPCONFIG
    
    echo "11. Backup of the ISPConfig Databse";
    mysqldump \
            -u$USER -p$PASSWORD -h$HOST \
            -Q -c -C --add-drop-table --add-locks --quick --lock-tables \
            db_ispconfig | gzip --best -c > $ISPCONFIG/db_ispconfig.sql.gz;
    
    
    echo "Restart Postfix"
    /etc/init.d/postfix start
    
    Regards.
     
  2. falko

    falko Super Moderator Howtoforge Staff

    This is for Fedora/CentOS, right? A few paths are different on Debian/Ubuntu.
     
  3. vaio1

    vaio1 Member

    yes it is.
    we are using CentoS 5.2.

    any suggestion?
     
  4. falko

    falko Super Moderator Howtoforge Staff

    For CentOS and Fedora, your script looks good. On Debian and Ubuntu, the paths to Vhosts_ispconfig.conf and named.conf are a bit different.
     
  5. vaio1

    vaio1 Member

    Infact I have CentOs.
    The question is another: Have I forgot something to backup?
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Yes, the web sites in /var/www.
     
  7. vaio1

    vaio1 Member

    I would like to move my server to the newer version of ISP Config3. Which are the files that have I save from the old ISP Config2 server to move to ISP Config3?

    thanks
     
  8. falko

    falko Super Moderator Howtoforge Staff

    You cannot upgrade from ISPConfig 2 to 3. The setups are totally different.
     
  9. vaio1

    vaio1 Member

    Hi falko,

    thanks for your reply is there a way to hide the upgrading from 2 to 3.0 to the users. I mean that all the parameters can remain the same to avoid the re-configuration of the clients?

    thanks
     
  10. falko

    falko Super Moderator Howtoforge Staff

    It's not possible to upgrade from ISPConfig 2 to 3.
     
  11. vaio1

    vaio1 Member

    So, have we send to the users the new credentials of all the services activated?
     
  12. falko

    falko Super Moderator Howtoforge Staff

    If you install ISPConfig 3 on a new server and recreate all accounts there, then yes.
     
  13. gr33d

    gr33d New Member

    ISPConfig 3 CentOS 5.4

    I don't have the files in steps 5 through 10. I followed the "Perfect Setup" for CentOS 5.4 and ISPConfig 3 for x86_64--though I substituted i386 due to hardware on my box.

    ISPConfig 3 is running basically as expected, but I am definitely anxious to back it up!

    Thanks in advance!
     
  14. falko

    falko Super Moderator Howtoforge Staff

    Please post this in the ISPConfig 3 forum.
     
  15. PermaNoob

    PermaNoob Member

    backup script for ISPconfig 2 on Debian Etch using duplicity

    Here's my backup script for ISPconfig 2 on Debian Etch using duplicity and backing up to disk2:


    cp /etc/passwd /disk2/backup1/ispconfigfiles
    cp /etc/shadow /disk2/backup1/ispconfigfiles
    cp /etc/group /disk2/backup1/ispconfigfiles
    cp /etc/apache2/vhosts/Vhosts_ispconfig.conf /disk2/backup1/ispconfigfiles
    cp /etc/postfix/local-host-names /disk2/backup1/ispconfigfiles
    cp /etc/postfix/virtusertable /disk2/backup1/ispconfigfiles
    cp /var/lib/named/etc/bind/named.conf /disk2/backup1/ispconfigfiles
    cp /etc/proftpd/modules.conf /disk2/backup1/ispconfigfiles
    cp /etc/proftpd/proftpd.conf /disk2/backup1/ispconfigfiles
    cp /etc/proftpd_ispconfig.conf /disk2/backup1/ispconfigfiles
    duplicity --no-encryption /root/ispconfig file:///disk2/backup1/ispconfigbackup
    duplicity --no-encryption /home/admispconfig file:///disk2/backup1/admispconfigbackup
    duplicity --no-encryption /var/www file:///disk2/backup1/allsitesbackup
     

Share This Page