Current time: 01-25-2022, 09:05 AM Hello There, Guest! (LoginRegister)


Post Reply 
[HowTo] Export ispCP to another Server
Author Message
kurgans Offline
Moderator
*****
Moderators

Posts: 1,565
Joined: Feb 2008
Reputation: 23
Post: #1
[HowTo] Export ispCP to another Server
I am very sorry that this in Spanish, I speak only Spanish translator software and use can lead to confusion and a bad translation.

The export works perfectly, has been tested only with debian rc7 and RC1.0

Please if someone speaks Spanish and English content to translate.

english Version below

------------------------------------------------------------------------------------------------------------------

Esta prueba ha sido echa con ISP-R7 y ISP1.0 y en ambos casos ha sido exitosa, quedando totalmente funcional.

Identificaremos los servidores con www-1 servidor actual y www-2 servidor nuevo

Preparativos:

-- Ambos servidores deben estar con la misma version del panel.
después de instalado se puede actualizar sin problemas.
-- Ambos servidores deben tener la misma clave mysql
-- Por defecto usaremos para todas las acciones la carpeta root en ambos servidores.
-- Parar demonio del panel en servidor nuevo (ispcp_daemon stop)

Instalar los paquetes necesarios:
Tan solo necesitamos el paquete
rsync -- apt-get install rsync (Debe estar en los 2 servidores)

Acciones a realizar:

-- Sacar una copia de los usuarios virtuales, grupo y 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

-- Pasar los archivos obtenidos al nuevo servidor usando scp
www-1# scp /root/*.vu root@newIP:/root/

-- Restaurar archivos sobre nuevo servidor
www-2# cat /root/passwd.vu >> /etc/passwd
www-2# cat /root/shadow.vu >> /etc/shadow
www-2# cat /root/group.vu >> /etc/group

-- Transferir configuraciones de postfix, courrier, proftpd y ispcp al nuevo servidor.
www-1# rsync -az -e ssh /etc/courier/* newIP:/etc/courier
www-1# rsync -az -e ssh /etc/postfix/* newIP:/etc/postfix
www-1# rsync -az -e ssh /etc/proftpd.conf newIP:/etc/
www-1# rsync -az -e ssh /etc/ispcp/ispcp.conf newIP:/etc/ispcp/ispcp.conf.old

-- Transferir keys al nuevo servidor
www-1# rsync -az -e ssh /var/www/ispcp/engine/ispcp-db-keys.pl newIP:/var/www/ispcp/engine/
www-1# rsync -az -e ssh /var/www/ispcp/engine/messager/ispcp-db-keys.pl newIP:/var/www/ispcp/engine/messager
www-1# rsync -az -e ssh /var/www/ispcp/gui/include/ispcp-db-keys.php newIP:/var/www/ispcp/gui/include/
www-1# rsync -az -e ssh /var/www/ispcp/gui/tools/pma/config.inc.php newIP:/var/www/ispcp/gui/tools/pma/config.inc.php

-- Copia de nuestro servidor mysql
www-1# mysqldump --all-databases --opt -Qc --add-drop-database -p -r /root/mysqldump.sql

-- transferir datos a nuevo servidor
www-1# scp /root/mysqldump.sql newIP:/root

-- Exportar bases de datos en nuevo servidor
www-2# mysql -p < mysqldump.sql

-- Cambiar la IP de mysql en servidor nuevo
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

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

-- transferir a servidor nuevo webs, buzones, logs y cron
www-1# rsync -az -e ssh /var/www/virtual/* newIP:/var/www/virtual
www-1# rsync -az -e ssh /var/mail/virtual/* newIP:/var/mail/virtual
www-1# rsync -az -e ssh /var/log/* newIP:/var/log
www-1# rsync -az -e ssh /var/spool/cron/* newIP:/var/spool/cron

-- Arrancar demonio ispcp en servidor nuevo
www-2# /etc/init.d/ispcp_daemon start

---- Resolucion de problemas despues de la exportacion
1º.- No Arranca el panel con error:
Connection failed: SQLSTATE[28000] [1045] Access denied for user root'@'localhost' (using password: YES)
--- Solucion:
1º.- Renombrar el archivo ispco.conf a ispcp.conf.bak
www-2# mv /etc/ispcp/ispcp.conf ispcp.conf.bak
2º.- Renombrar el archivo ispcp.conf.old a ispcp.conf
www-2# www-2# mv /etc/ispcp/ispcp.conf.old ispcp.conf

Al refrescar la pantalla sigue sin funcionar el panel

Es normal que no os de el panico viene dado por la falta de conexion del usuario de sistema al mysql.

www-2# /etc/init.d/mysql restart
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld ..
Checking for corrupt, not cleanly closed and upgrade needing tables..
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
www-2# ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

-- Solucion del problema de conexion
1º.- Editar el archivo /etc/mysql/debian.cnf
Sale algo parecido a esto
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = debian-sys-maint
password = 51RsCKiYduWP835x
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
user = debian-sys-maint
password = 51RsCKiYduWP835x
socket = /var/run/mysqld/mysqld.sock
basedir = /usr

El error como observais se da por la falta de conexion de usuario debian-sys-maint'@'localhost, y es que su password exportado no coincide con el generado por el sistema automaticamente, luego hay que hacerlo de forma manual por sql.

Tan solo copiar el password y vamos a sql
www-2# /etc/mysql# mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.0.51a-24 (Debian)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> GRANT ALL PRIVILEGES ON * . * TO 'debian-sys-maint'@'localhost'
-> IDENTIFIED BY '51RsCKiYduWP835x' // Password copiado de debian.conf
-> WITH GRANT OPTION
-> MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR
-> 0 MAX_USER_CONNECTIONS 0 ;
Query OK, 0 rows affected (0.01 sec)

mysql> quit

www-2#

Ya funciona nuestro panel pero aun hay que hacerle un ultimo retoque.
Al entrar en el panel que funciona los dominios no estan activos aun, por lo que hay que irse a herramientas de sistema y usar la opcion ispcp_debugger, le damos una vez y el sistema se pone en status

El demonio ha retornado 250 como código de estado
(Jo parece que estoy flasheando una 360 jejej con los retornos de estado)
Una vez retornado a 250 ejecutamos las consultas que sean necesarias el propio debugger se encargará de hacerlo marcando en la parte inferior el link

ispCP - Herramientas de Proceso
25 Ejecutar consultas

Pulsamos

Y todo nuestro panel esta operativo al 100%
(This post was last modified: 10-07-2009 05:57 AM by gOOvER.)
04-02-2009 06:14 AM
Visit this user's website Find all posts by this user Quote this message in a reply
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #2
RE: Export ispcp to another server
thx kurgans...

when there is noone in the forum until the end of the week, I will ask a colleage to translate it to german. I will translate it to english then ;-))
04-02-2009 06:19 AM
Visit this user's website Find all posts by this user Quote this message in a reply
kurgans Offline
Moderator
*****
Moderators

Posts: 1,565
Joined: Feb 2008
Reputation: 23
Post: #3
RE: Export ispcp to another server
Ok, thanks a lot do not feel able to give their content in other languages, but my translator is very bad.
04-02-2009 06:23 AM
Visit this user's website Find all posts by this user Quote this message in a reply
mikezs Offline


Posts: 4
Joined: Jul 2008
Reputation: 0
Post: #4
RE: HowTo Export ispcp to another server
Has this been translated yet?
04-28-2009 12:11 AM
Find all posts by this user Quote this message in a reply
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
hoangnam8484 Offline
Junior Member
*

Posts: 13
Joined: Sep 2009
Reputation: 0
Post: #6
RE: [HowTo] Export ispCP to another Server
I follow the instructions above.

All ok, but I use FTP user to upload to a domain I receive the message "550 Access is denied." I tried to set folder permission 777, but still receive notification as above.
http://farm3.anhso.net/upload/20101203/1...s_deni.jpg

Please help me!
(This post was last modified: 12-03-2010 06:16 PM by hoangnam8484.)
12-03-2010 06:08 PM
Find all posts by this user Quote this message in a reply
mr.x Offline
Development Team
*****
Dev Team

Posts: 232
Joined: Nov 2006
Reputation: 3
Post: #7
RE: [HowTo] Export ispCP to another Server
Hi,

(12-03-2010 06:08 PM)hoangnam8484 Wrote:  I follow the instructions above.

All ok, but I use FTP user to upload to a domain I receive the message "550 Access is denied." I tried to set folder permission 777, but still receive notification as above.
Please help me!

What about your logfiles? Please show us your prodtpd log

BR
/Mr.X
12-03-2010 06:11 PM
Find all posts by this user Quote this message in a reply
hoangnam8484 Offline
Junior Member
*

Posts: 13
Joined: Sep 2009
Reputation: 0
Post: #8
RE: [HowTo] Export ispCP to another Server
I follow the following path:/var/log/proftpd/proftpd.log

But the logfile is empty

/var/log/proftpd# cat proftpd.log

proftp the other path is not recorded?
12-03-2010 06:37 PM
Find all posts by this user Quote this message in a reply
hoangnam8484 Offline
Junior Member
*

Posts: 13
Joined: Sep 2009
Reputation: 0
Post: #9
RE: [HowTo] Export ispCP to another Server
I have found out the cause!

Your ISA is set read-only

Thanks!
12-03-2010 09:02 PM
Find all posts by this user Quote this message in a reply
mr.x Offline
Development Team
*****
Dev Team

Posts: 232
Joined: Nov 2006
Reputation: 3
Post: #10
RE: [HowTo] Export ispCP to another Server
(12-03-2010 09:02 PM)hoangnam8484 Wrote:  I have found out the cause!

Your ISA is set read-only

Thanks!

???
Could you please describe your solution with more details for other with the same issue?

BR
/Mr.X
12-03-2010 09:57 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


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