Current time: 11-23-2024, 02:33 AM Hello There, Guest! (LoginRegister)


Post Reply 
Migrating VHCS on Ubuntu 8.04
Author Message
chrisi99 Offline
Junior Member
*

Posts: 28
Joined: Jun 2008
Reputation: 0
Post: #1
Migrating VHCS on Ubuntu 8.04
Hi there!

I am currently setting up a new Server and therefore want to migrate from VHCS (now over 2 years old) to ispcp.

My VHCS is heavily modded, so i decided to do a fresh and clean start!

I allready found the packages list for ubuntu 8.04 under http://isp-control.net/ispcp/browser/tru...y?rev=1176

and run into an error with libperl5.10 - it seems the package is not available for 8.04. Does anyone know, if that may end in an more severe problem there?

What currently is more important to me is the question, if migration would be possible an a more or less swift way?

I only host about 10 "Clients" (private projects) on vhcs, how hard is migration in general (read many different opinions here on the board)?

PS: there isn't a installation script around right now by any chance? The one I found does not support hardy atm

best wishes from Austria/Europe
Chris
(This post was last modified: 06-11-2008 05:33 AM by chrisi99.)
06-11-2008 05:27 AM
Find all posts by this user Quote this message in a reply
sci2tech Away
Senior Member
****

Posts: 1,285
Joined: Jan 2007
Reputation: 23
Post: #2
RE: Migrating VHCS on Ubuntu 8.04
I think that libperl5.8 should be ok. I just migrated 300+ accounts this way:
I did export following tables:
Quote:admin ftp_group htaccess_groups mail_users reseller_props sql_user auto_num ftp_users htaccess quotalimits server_ips subdomain domain hosting_plans htaccess_users quotatallies sql_database user_gui_props
and after instalation i did a manual import of this tables in ispcp database. I saved /var/www/virtual and /var/lib/mysql in /oldvhcs/var/www/ respectively /oldvhcs/var/lib/mysql. and use this script:
Code:
#!/bin/bash
rm -fR /oldvhcs/var/lib/mysql/ispcp
for domain_id in `echo "SELECT domain_id FROM ispcp.domain" | mysql --defaults-file=/home/sci2tech/.my.cnf -s`;
do
    uid=`echo "SELECT domain_uid FROM ispcp.domain WHERE domain_id='$domain_id'" | mysql --defaults-file=/home/sci2tech/.my.cnf -s`;
    gid=`echo "SELECT domain_gid FROM ispcp.domain WHERE domain_id='$domain_id'" | mysql --defaults-file=/home/sci2tech/.my.cnf -s`;
    dmn=`echo "SELECT domain_name FROM ispcp.domain WHERE domain_id='$domain_id'" | mysql --defaults-file=/home/sci2tech/.my.cnf -s`;
    echo "===========================================================";
    echo "            $dmn";
    echo "===========================================================";
    echo "===========================================================" >&2
    echo "            $dmn" >&2
    echo "===========================================================" >&2
# process mysql
    for db_id in `echo "SELECT sqld_id FROM ispcp.sql_database WHERE domain_id='$domain_id'" | mysql --defaults-file=/home/sci2tech/.my.cnf -s`;
    do
        db_name=`echo "SELECT sqld_name FROM ispcp.sql_database WHERE sqld_id='$db_id'" | mysql --defaults-file=/home/sci2tech/.my.cnf -s`;
        for db_user_name in `echo "SELECT sqlu_name FROM ispcp.sql_user WHERE sqld_id='$db_id'" | mysql --defaults-file=/home/sci2tech/.my.cnf -s`;
        do
            db_user_pass=`echo "SELECT sqlu_pass FROM ispcp.sql_user WHERE sqld_id='$db_id' AND sqlu_name='$db_user_name'" | mysql --defaults-file=/home/sci2tech/.my.cnf -s`;
            echo "grant all on \`$db_name\`.* to '$db_user_name'@'localhost' identified by '$db_user_pass'" | mysql --defaults-file=/home/sci2tech/.my.cnf -s;
            echo "grant all on \`$db_name\`.* to '$db_user_name'@'%' identified by '$db_user_pass'" | mysql --defaults-file=/home/sci2tech/.my.cnf -s;
        done
        cp -vR /oldvhcs/var/lib/mysql/$db_name /var/lib/mysql/
    done

# process ftp
    echo "UPDATE \`ispcp\`.\`ftp_group\` SET \`gid\`='$gid' WHERE \`groupname\`='$dmn'" | mysql --defaults-file=/home/sci2tech/.my.cnf -s
    echo "UPDATE \`ispcp\`.\`ftp_users\` SET \`uid\`=$uid, \`gid\`='$gid' WHERE \`userid\` like '%@$dmn'" | mysql --defaults-file=/home/sci2tech/.my.cnf -s
    cp -vR /oldvhcs/var/www/virtual/$dmn /var/www/virtual/
    chown -vR vu$uid:vu$gid /var/www/virtual/$dmn
    chown -v vu$uid:www-data /var/www/virtual/$dmn
    chown -vR vu$uid:www-data /var/www/virtual/$dmn/backups
    chown -vR vu$uid:www-data /var/www/virtual/$dmn/logs
    chown -vR vu$uid:www-data /var/www/virtual/$dmn/phptmp
    chown -vR root:root /var/www/virtual/$dmn/cgi-bin

done
chown -vR mysql:mysql /var/lib/mysql
/hme/sci2tech/.my.cnf is like this:
Quote:[client]
user=root
password=MYSQLPASSWORD
I did this way becose of many mods i did to survive for 2 years with vhcs2. Maybe my way will inspire you what to do Wink
(This post was last modified: 06-11-2008 06:58 AM by sci2tech.)
06-11-2008 06:55 AM
Visit this user's website Find all posts by this user Quote this message in a reply
chrisi99 Offline
Junior Member
*

Posts: 28
Joined: Jun 2008
Reputation: 0
Post: #3
RE: Migrating VHCS on Ubuntu 8.04
thank for your excellent reply!

Did you have to modify files beyond the mentioned?

best wishes
Chris
06-11-2008 07:18 AM
Find all posts by this user Quote this message in a reply
chrisi99 Offline
Junior Member
*

Posts: 28
Joined: Jun 2008
Reputation: 0
Post: #4
RE: Migrating VHCS on Ubuntu 8.04
It would also be possible for me to do a soft migration, since the projects are all more or less private and a short downtime would not be that bad.

What would you (any of you) suggest? I could create all Users manual in ispcp and then create databases etc, export them from vhcs and import them in ispcp. At last copy the userdata and voila...

Any idea is appreciated Smile

PS: excuse my english, my mother-tongue is german Smile
06-11-2008 08:02 PM
Find all posts by this user Quote this message in a reply
sci2tech Away
Senior Member
****

Posts: 1,285
Joined: Jan 2007
Reputation: 23
Post: #5
RE: Migrating VHCS on Ubuntu 8.04
chrisi99 Wrote:Did you have to modify files beyond the mentioned?
No i didn`t modify any of that table dumps. I used phpmyadmin to dump the data from tables (don`t save the structure of the tables, you only need the data).
06-12-2008 01:28 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


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