Current time: 05-03-2024, 02:42 AM Hello There, Guest! (LoginRegister)


Post Reply 
[HowTo] Export ispCP to another Server
Author Message
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #5
RE: HowTo Export ispcp to another server
This instructions have been successfully tested using both Ispcp RC7 and Ispcp 1.0, ending with a completely functional migrated system.

As a convention, we will identify the old server as www-1 and the new one as www-2. throughout this guide.

Preliminary arrangements:

-- Both servers must use the same ispcp version (you can upgrade www-2 as usual when the migration is done).
-- Both servers must have the same mysql password.
-- All commands on both hosts will be issued from the root folder by default (cd /).
-- Stop the ispcp daemon of the www-2 host so it doesn't interfere with the process.

Package requirements: only rsync needed (on both servers). In debian we can just execute apt-get install rsync at each host.

Migration steps:

-- Extract a copy of all virtual users, their groups and passwords
www-1# cat /etc/passwd | grep '^vu.*:' > /root/passwd.vu
www-1# cat /etc/group | grep '^vu.*:' > /root/group.vu
www-1# cat /etc/shadow | grep '^vu.*:' > /root/shadow.vu

-- Transfer these files to the new server using scp
www-1# scp /root/*.vu root@www-2:/root/

-- Add the info from these files to the new server
www-2# cat /root/passwd.vu >> /etc/passwd
www-2# cat /root/shadow.vu >> /etc/shadow
www-2# cat /root/group.vu >> /etc/group

-- Transfer postfix, courier, proftpd and ispcp configurations to the new server.
www-1# rsync -az -e ssh /etc/courier/* www-2:/etc/courier
www-1# rsync -az -e ssh /etc/postfix/* www-2:/etc/postfix
www-1# rsync -az -e ssh /etc/proftpd.conf www-2:/etc/
www-1# rsync -az -e ssh /etc/ispcp/ispcp.conf www-2:/etc/ispcp/ispcp.conf.old

-- Transfer the ispcp keys and phpMyAdmin config
www-1# rsync -az -e ssh /var/www/ispcp/engine/ispcp-db-keys.pl www-2:/var/www/ispcp/engine/
www-1# rsync -az -e ssh /var/www/ispcp/engine/messager/ispcp-db-keys.pl www-2:/var/www/ispcp/engine/messager
www-1# rsync -az -e ssh /var/www/ispcp/gui/include/ispcp-db-keys.php www-2:/var/www/ispcp/gui/include/
www-1# rsync -az -e ssh /var/www/ispcp/gui/tools/pma/config.inc.php www-2:/var/www/ispcp/gui/tools/pma/config.inc.php

-- Extract a copy of all databases
www-1# mysqldump --all-databases --opt -Qc --add-drop-database -p -r /root/mysqldump.sql

-- Transfer it to the new server
www-1# scp /root/mysqldump.sql www-2:/root

-- Import them into the new server mysql
www-2# mysql -p < mysqldump.sql

-- Change mysql's IP on the new server
www-2# mysql -p
www-2# mysql>use ispcp
www-2# mysql> UPDATE server_ips SET ip_number = "newIP" WHERE ip_id = 1;
Query OK, 1 row affected (0.02 sec)
Rows matched: 1 Changed: 1 Warnings: 0

-- Mark all domain/subdomains/mail configurations for regeneration (so they work with the new IP)
www.-2# mysql> UPDATE `domain` SET `domain_status` = 'change' WHERE `domain_status` = 'ok' ;
Query OK, 6 rows affected (0.00 sec)
www-2# mysql> UPDATE `subdomain` SET `subdomain_status` = 'change' WHERE `subdomain_status` = 'ok';
www-2# mysql> UPDATE `domain_aliasses` SET `alias_status` = 'change' WHERE `alias_status` = 'ok';
www-2# mysql> UPDATE mail_users SET status="toadd" where status="ok";
Query OK, 19 rows affected (0.01 sec)
Rows matched: 19 Changed: 19 Warnings: 0

www-2# mysql>quit
www-2# /var/www/ispcp/engine/ispcp-rqst-mngr

-- Transfer websites, mailboxes, logs and cronfiles to the new server
www-1# rsync -az -e ssh /var/www/virtual/* www-2:/var/www/virtual
www-1# rsync -az -e ssh /var/mail/virtual/* www-2:/var/mail/virtual
www-1# rsync -az -e ssh /var/log/* www-2:/var/log
www-1# rsync -az -e ssh /var/spool/cron/* www-2:/var/spool/cron

---- Troubleshooting

after exporting

1.- The ispcp panel (gui) doesn't work, showing this error:
Connection failed: SQLSTATE[28000] [1045] Access denied for user root'@'localhost' (using password: YES)
-- Solution:
Backup current ispcp.conf file and replace it with the ispcp.conf.old one
www-2# mv /etc/ispcp/ispcp.conf ispcp.conf.bak
www-2# mv /etc/ispcp/ispcp.conf.old ispcp.conf

-- Mysql debian mainteinance system problem section skipped because I've no time right now to translate it Tongue

-- FINALLY

-- Regenerate the configs and launch the ispcp daemon on the new server
www-2# /var/www/ispcp/engine/ispcp-rqst-mngr
www-2# /etc/init.d/ispcp_daemon start

After this, everything should be up and running at full speed!
04-28-2009 01:06 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Export ispcp to another server - rbtux - 04-02-2009, 06:19 AM
RE: HowTo Export ispcp to another server - kilburn - 04-28-2009 01:06 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)