ISPConfig Migration and Upgrade

Discussion in 'Installation/Configuration' started by guimnk, Apr 6, 2010.

  1. guimnk

    guimnk Member

    Hi all..

    I've 2 questions, please, help-me. I have 2 servers running ISPConfig 3.0.16.

    Server A: Ubuntu 9.04 32bits
    Server B: Ubuntu 9.10 64bits

    1) How can I do to migrate ISPConfig 3.0.1.6 from Server A to Server B?



    2) How can I do to upgrade ISPConfig from version 3.0.1.6 to 3.0.2.1?



    Thanks
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The migration steps are:

    1) Install the same ispconfig version on the second server.
    2) move all lines for the web* and client* users and groups from /etc/passwd and /etc/shadow and /etc/group and /etc/gshadow to the same files on the new server. Copy just these lines and not the whole files!
    3) Copy the /var/www and /var/vmail directories to the new server. Make sure that you preserve permissions by e.g. using these tar commands:

    tar pcfz www.tar.gz /var/www

    tar pcfz vmail.tar.gz /var/vmail

    4) Move the ispconfig mysql database to the new server and also move all client databases to the new server.


    To your second question: To update ispconfig, run the commands:

    ispconfig_update.sh

    as root user on the shell.
     
  3. guimnk

    guimnk Member

    Thank you Till..

    Is very important run this command after the importation of 'information_schema' of old mysql server in new mysql server..

    Code:
    mysql_upgrade -u root -h localhost -p –v –f
    Before this command, I get amavisd errors.. Now, is fixed..

    Hmm.. I get errors with ISPConfig user in mysql.. Then, I copy the password generated in /etc/mydns.conf and replace the mysql password of ispconfig user.. The error is fixed..

    Till, How can I do to enable HA in ISPConfig3 ?
     
  4. Naudski

    Naudski New Member

    Hai Till,

    How about migrating the symbolic links in the /var/www/ dir?
    The tar pcfz command doesn't preserve the symbolic links or am I doing something wrong here?

    Regards,
    Naudski
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    The command tar pcfz preserves the links.
     
  6. guimnk

    guimnk Member

    Follow just till said, then you'll be able to migrate...

    OR

    To migrate using rsync:

    Code:
    
    rsync -avu /var/www [email protected]:/var/
    rsync -avu /var/vmail [email protected]:/var/
    
    # 192.168.1.100 = target server
    
    
    To migrate MySQL, use this script:

    Code:
    
    #!/bin/bash
    # where your mysql commands are
    CMD_MYSQL="/usr/bin/mysql"
    CMD_MYSQLDUMP="/usr/bin/mysqldump"
    
    # login credentials of the submitting side
    DB_USER_FROM="root"
    DB_PASS_FROM="your_password"
    DB_HOST_FROM="localhost"
    
    # login credentials of the receiving side
    DB_USER_TO="root"
    DB_PASS_TO="password_of_target_server"
    DB_HOST_TO="192.168.1.100" # IP of target server...
    
    # index all databases on the local (submitting) side
    echo "database sync"
    DATABASES=`echo "SHOW DATABASES;" | ${CMD_MYSQL} -p${DB_PASS_FROM} -u ${DB_USER_FROM} -h ${DB_HOST_FROM}`
    
    # loop over all the databases
    for DATABASE in $DATABASES; do
      # skip non-databases
      if [ "${DATABASE}" != "Database" ] && [ "${DATABASE}" != "information_schema" ]; then
        echo "transmitting ${DATABASE}"
    
        # create database on remote (receiving) side if it doesn't exist
        echo "CREATE DATABASE IF NOT EXISTS ${DATABASE}" | ${CMD_MYSQL} -p${DB_PASS_TO} -u ${DB_USER_TO} -h ${DB_HOST_TO}
    
        # dump the current database and pipe it directly to the remote (receiving) side to inject it
        ${CMD_MYSQLDUMP} -Q -B --create-options --delayed-insert --complete-insert --quote-names --add-drop-table -p${DB_PASS_FROM} -u${DB_USER_FROM} -h${DB_HOST_FROM} ${DATABASE} | ${CMD_MYSQL} -p${DB_PASS_TO} -u ${DB_USER_TO} -h ${DB_HOST_TO} ${DATABASE}
      fi
    done
    
    
     
  7. Lukash

    Lukash New Member

    Hello All,

    I have single server Debian 5.0 with BIND & Dovecot and ISPConfig 3 updated with all Debian security updates and with ISPConfig version 3.0.4.2. Now I have a plan to migrate it to Web, Email And MySQL Database Cluster (Mirror) with BIND & Courier on Debian 6.0. Regarding mentioned case I have few questions:
    1) is this operation possible?
    2) may I use follwing tutorials for this operation
    http://www.howtoforge.com/installin...tabase-cluster-on-debian-5.0-with-ispconfig-3
    http://www.howtoforge.com/perfect-server-debian-squeeze-with-bind-and-courier-ispconfig-3 ?
    3) do you have a different (better) ideas for mirrored ISPConfig servers?
    Thank you in advance for support.

    Lukash
     
  8. guimnk

    guimnk Member

    Hi Lukash!

    1) Yes, it's possible.
    2) You want to migrate and use this new server as a production server or you want to use this new server for backups (mirror)?
    3) If you want to migrate and use this new server as a production server, you want to follow the ideas in this post. If you want to synchronize your data in new server, you have other ways to do... Ex: using rsync with cron job, using mysql backup with cron job, and more..
     
  9. Lukash

    Lukash New Member

    Hi guimnk,

    Thanx for fast answer.
    1) Good information.
    2) I have 2 completly new servers with Debian 6.0.4 (base system + ssh only) installed. I want to install this servers as mirrored ISPConfig servers with mentioned tutorial. Afterwards migrate single server (settings, websites, emails, dns, etc.) to this two mirrored servers. After migration single server will be turned off. Do you have any advices for this operation?
    Greetings.

    Lukash
     

Share This Page