
6th March 2010, 15:38
|
|
Junior Member
|
|
Join Date: Jan 2008
Posts: 20
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
In my experiences it would be best to go ahead and update the old box to the new version of ISPConfig or install the old version on the new box. Same version transfers are usually less trouble. Beyond that, just dump your entire database, move the files, restore database, and you are basically done.
|

6th March 2010, 18:39
|
|
Junior Member
|
|
Join Date: Sep 2009
Posts: 21
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
I read in another post that mysql version need to be identical for transfer. In my enviroment both servers use different versions of mysql.
So will I get problems when doing a dump and restore or when just copying what's within /var/lib/mysql...
THX!
|

22nd August 2010, 17:34
|
|
Junior Member
|
|
Join Date: May 2006
Location: Berlin
Posts: 19
Thanks: 4
Thanked 1 Time in 1 Post
|
|
Apparently I just finished soemthing impossible: I moved from an "old server" running ISPConfig 2.2.29 to a "new server" running 2.2.37.
I had to do an emergency recovery of a crashed server. I was able to backup all SQL databases in a dump and to perform an backup as described here http://www.howtoforge.com/forums/showthread.php?t=2717
Afterwards I installed ISPConfig 2.2.37 following http://www.howtoforge.com/perfect-se...64-ispconfig-2
Having done this I restored all data an got an error message "The requested document type does not exist." each time I tried to change any user or website settings inside ISPConfig. So I reinstalled ISPConfig 2.2.37 and the problem was solved.
Sometimes one has to post a success story just to say thank you to the developers and all forum contributors!
|

22nd August 2010, 17:38
|
|
Junior Member
|
|
Join Date: May 2006
Location: Berlin
Posts: 19
Thanks: 4
Thanked 1 Time in 1 Post
|
|
Using mysqldump and mysql on the command line or phpmyadmin there shouldn't occur any problems. You will have to take care not to mix up codepages. If you get scrambled special caracters you will find additional informations in in these forums and in the Mysql doc.
|

20th September 2010, 13:45
|
|
Member
|
|
Join Date: Oct 2007
Posts: 58
Thanks: 5
Thanked 3 Times in 2 Posts
|
|
Hi,
Yesterday I migrate to a new server using information I get in this post. All is running fine now, so this is another success story.
I am not an expert at all, but I would like to share this little "how to" have made using contributions I have read here and on others places. I have no doubt the migration can be done better but at least this way worked fine for me.
I have ISPconfig 2.2.37 running on debian 5.
I did not created the Postfix transport to forward emails to the new server (should be added to this howto).
Of course I am not sure there is no error, you do this howto at your own risk.
If you see something have to be added or corrected, please let us know.
I hope this will help some of you.
Quote:
// OLD SERVER
//if not done, update ispconfig2 to the latest version
// I assume you have created the cpdb.bash file and make it runnable by: "chmod a+x cpdb.bash" the containing of the cpdb.bash file is at the end of this text.
// create your backups folder if you do not already have one:
cd /root
mkdir backups
// create a "today" directory
today=`date +%d-%m-%y`
cd /root/backups
mkdir $today
cd $today
// I will create 3 compressed files that are "data.tar.gz", "www.tar.gz" and "tarsql"
mkdir data
/etc/init.d/postfix stop
//if one of the following lines fails, use "locate" to find where are the needed files on your server:
//example: locate pri.*
//before using locate, it is good to run updatedb
//if locate is not installed on your server, run "apt-get install locate" and then run "updatedb"
cp /etc/passwd /root/backups/$today/data
cp /etc/shadow /root/backups/$today/data
cp /etc/group /root/backups/$today/data
cp /etc/apache2/vhosts/Vhosts_ispconfig.conf /root/backups/$today/data
cp /etc/postfix/local-host-names /root/backups/$today/data
cp /etc/postfix/virtusertable /root/backups/$today/data
cp /var/lib/named/etc/bind/named.conf /root/backups/$today/data
cp /etc/proftpd*.conf /root/backups/$today/data
cp /var/lib/named/etc/bind/pri.* /root/backups/$today/data
/etc/init.d/postfix start
// emails received from now will not be included in the backup.
tar -pczf data.tar.gz data/
rm -r data
./cpdb.bash
tar -pczf tarsql *.sql
rm *.sql
// changes in your databases from now will not be included in the backup
tar -pczf www.tar.gz /var/www/
// (or replace by the folder containing your webs)
// NEW SERVER
//Do the corresponding perfect setup as shown at "http://www.ispconfig.org/ispconfig-2/installation-instructions-for-ispconfig-2/"
// if you are using the remote framework (like me) do not forget:
apt-get install libxml2-dev
// I am supposing you only have remote access to your server, for in case your PC looses conexion to internet I would suggest this:
apt-get install screen
screen
//If you loose access to your server, you can reload the current shell using: "screen -rd"
// INSTALL ISPCONFIG
cd /root
mkdir ispconfig_temp
cd ispconfig_temp
wget -c http://sourceforge.net/projects/ispc...ar.gz/download
// (replace with the current link for last ispconfig version dowload)
tar xvfz ISPConfig-2.x.xx.tar.gz
cd install_ispconfig
//If you use remote framework:
vi compile_aps/compile
add the folowing line:
WITH_XML=""
just after the WITH_XML variable is beeing set, so that php will compile with XML in all cases.
//if you have already ran the ispconfig instalation and it failed, run:
mkdir /root/ispconfig
./setup
//check you have access to the control panel : "https://yourip:81"
cd /root
mkdir backups
cd backups
today=`date +%d-%m-%y`
mkdir $today
cd $today
apt-get install sftp
sftp ip_old_server
root
your_root_pass_on_old_server
get /root/backups/19-09-10/data.tar.gz (replace the date)
get /root/backups/19-09-10/www.tar.gz
get /root/backups/19-09-10/tarsql
exit
// MYSQL
mkdir db
mv tarsql db/
cd db
tar xvfz tarsql
rm tarsql
// this will make a good job I think:
perl -pi -e 's/old_ip/new_ip/g' db_ispconfig.sql
perl -pi -e 's/old_host/new_host/g' db_ispconfig.sql
perl -pi -e 's/old_domain/new_domain/g' db_ispconfig.sql
// if (like me) you have undreeds of databases, you can:
ls > list.txt
// download list.txt with filezilla on your pc and using a advanced text editor, you replace the "new line" character and make the file look like:
#!/bin/bash
#recovering dbs
mysql < database_1.sql -h localhost -u root -pyour_mysql_root_pass
mysql < database_2.sql -h localhost -u root -pyour_mysql_root_pass
mysql < database_3.sql -h localhost -u root -pyour_mysql_root_pass
mysql < database_4.sql -h localhost -u root -pyour_mysql_root_pass
mysql < database_5.sql -h localhost -u root -pyour_mysql_root_pass
.....
// relaod the list.txt
chmod a+x list.txt
./list.txt
// WWW
// (supposing your web files are in the /var/www/ file)
mv www.tar.gz /var/
cd /var
mv www www_delete_me_if_all_ok
tar xvfz www.tar.gz
// DATA
cd /root/backups/18-09-10
tar xvfz data.tar.gz
// have a look at passwd, shadow, group files and if necesary update them with files from old server changing ip, host and domain.
// use the perl command:
perl -pi -e 's/old_string/new_string/' file
// you will have to do it at least with the pri.*, proftpd* and Vhosts_ispconfig.conf files:
perl -pi -e 's/old_ip/new_ip/g' pri.*
perl -pi -e 's/old_ip/new_ip/g' proftpd*
perl -pi -e 's/old_host/new_host/g' proftpd*
perl -pi -e 's/old_domain/new_domain/g' proftpd*
perl -pi -e 's/old_ip/new_ip/g' Vhosts_ispconfig.conf
perl -pi -e 's/old_host/new_host/g' Vhosts_ispconfig.conf
perl -pi -e 's/old_domain/new_domain/g' Vhosts_ispconfig.conf
cd /var/lib/named/etc/bind/
mkdir bind_delete_me_if_all_ok
cp * bind_delete_me_if_all_ok/
cp /root/backups/18-09-10/data/pri.* /var/lib/named/etc/bind/
cd /etc
mkdir proftpd_delete_me_if_all_ok
mv proftpd.conf proftpd_delete_me_if_all_ok/
mv proftpd_ispconfig.conf proftpd_delete_me_if_all_ok/
cp /root/backups/18-09-10/data/etc/proftpd.conf /etc/
cp /root/backups/18-09-10/data/etc/proftpd_ispconfig.conf /etc/
//check files in /etc/apache2/vhosts and /etc/postfix and replace them if necesary
/etc/init.d/proftpd restart
/etc/init.d/apache2 restart
https://yourip:81
enable Maildir under Management -> Server -> Settings -> EMail in the ISPConfig web interface
Change nameserver ns1 and ns2 to the new server ip.
If all ok, "locate delete_me_if_all_ok" and remove.
///// CONTAINING OF cpdb.bash FILE ////////
CMD_MYSQL="/usr/bin/mysql"
CMD_MYSQLDUMP="/usr/bin/mysqldump"
# login credentials of the submitting side
DB_USER_FROM="root"
DB_PASS_FROM="your_root_pass_for_mysql"
DB_HOST_FROM="localhost"
# 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}`
for DATABASE in $DATABASES; do
# skip non-databases
if [ "${DATABASE}" != "Database" ] && [ "${DATABASE}" != "information_schema" ]; then
${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} > ${DATABASE}.sql
fi
done
|
|
|
The Following 2 Users Say Thank You to gauthier For This Useful Post:
|
falko (21st September 2010),
till (20th September 2010)
|

13th October 2010, 09:30
|
|
Member
|
|
Join Date: Mar 2008
Posts: 37
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
Hi Falko,
a huge thank you for this fantastice howto that helped me loads.
Quote:
Originally Posted by falko
On the old server, create a Postfix transport now so that all emails are forwarded to the ne server (for the time until the MX records of your domains have switched to the new server):
Code:
echo "* smtp:[<IP address of new server>]" >> /etc/postfix/transport
postmap /etc/postfix/transport
/etc/init.d/postfix restart
On the new server, open /etc/postfix/local-host-names and add the hostname of the old server at the bottom so that the new server accepts the forwarded mails.
|
Being in the process of moving my ISPConfig 2 installation to another server (which is going to have the same hostname.domainname, just another IP address), I was wondering if there is a way to create a transport that
...sends every mail to the IP address of the new server (as described)
...plus delivers the mail locally, as Postfix always used to.
By this means it wouldn't be an issue how long the DNS transition of the domainnames would take. Mail-wise, the two machines would always be in sync.
Could you give me a pointer on how to confure a postfix transport that would do exactly this?!
Thanks and regards,
Tom
|

5th March 2011, 12:39
|
|
Senior Member
|
|
Join Date: Sep 2005
Posts: 1,186
Thanks: 60
Thanked 13 Times in 11 Posts
|
|
Can this advice be used to migrate from Debian Lenny ISPCFG3 to Debian Squeeze ISPCFG3?
What is the easiest way to sync emails? I mean keep them in sync for a few days until the MX-records become active?
and btw. if I am using the method described here to import: http://www.howtoforge.com/faq/6_4_en.html I get an error. Right now trying to find a way to import the dump.
Quote:
h1870666:~/old-stuff-import# mysql -h localhost -u root -pmysecret c1zice < c1zice.sql
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Warning: The option '--all' is deprecated and will be removed in a future releas' at line 1
h1870666:~/old-stuff-import#
|
Last edited by Ovidiu; 5th March 2011 at 16:43.
|

6th March 2011, 21:26
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,592 Times in 2,443 Posts
|
|
Quote:
Originally Posted by Ovidiu
Can this advice be used to migrate from Debian Lenny ISPCFG3 to Debian Squeeze ISPCFG3?
|
No, this is for ISPConfig 2, not 3.
Quote:
Originally Posted by Ovidiu
What is the easiest way to sync emails? I mean keep them in sync for a few days until the MX-records become active?
|
I'd use imapsync: http://www.howtoforge.com/how-to-mig...-with-imapsync
Quote:
Originally Posted by Ovidiu
|
Please open c1zice.sql. There seems to be non-SQL syntax in it, like
Code:
Warning: The option '--all' is deprecated and will be removed in a future releas
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 07:11.
|
|
Recent comments
1 day 4 hours ago
1 day 9 hours ago
1 day 11 hours ago
1 day 12 hours ago
1 day 13 hours ago
1 day 18 hours ago
1 day 19 hours ago
1 day 21 hours ago
2 days 10 hours ago
2 days 12 hours ago