macuser777
asked on
Changing hosts/servers.
I have a site in development that has cgi/perl and php.
I want to transfer hosts and servers as the guy who set me up on this package has disappeared.
Will a new hosting company be able to do everything for me- transfer all files etc and keep the site at the same stage of development?
I don't know anything about cgi but i keep reading about how it has to be installed properly on servers - is this something i will need to watch for?
I have contol panel access.
Thanks
I want to transfer hosts and servers as the guy who set me up on this package has disappeared.
Will a new hosting company be able to do everything for me- transfer all files etc and keep the site at the same stage of development?
I don't know anything about cgi but i keep reading about how it has to be installed properly on servers - is this something i will need to watch for?
I have contol panel access.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Well tar.gz is fine. Make sure your host gives you shall access or has shell access. You can then upload the tar.gz and unpack it right on the server into the same format. Also, winzip can decompress it all, so you can use a normal FTP to upload everything again as well.
all the cpanel skins are the same in functionaility in my opinion. It i just the way it is organized/layed out which differs and suits different people better.
hope that helps,
-kohashi
all the cpanel skins are the same in functionaility in my opinion. It i just the way it is organized/layed out which differs and suits different people better.
hope that helps,
-kohashi
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi
Thanks for the input :)
I just having a forum chat with e3servers.com
They do run Linux and cPanel, and i do have full access to the domain registration records fortunately - so i can quickly repoint the dns nameservers.
at e3 they said just changing the nameservers works in some cases if you're going from one cPanel host to another. So that's option1.
actually - here's all they said...
>>>>>>>>"Because you are using another cPanel server right now it might be able to transfer over all of your accounts automatically and you would just have to change nameserver information. This works in a lot of cases, but if it doesn't then what you would have to do is this: backup your site at the old cPanel server. Then download the backup to your computer. Create the site on our new server. Then log into the new server and "Restore" the account. This should move everything over in tact. If this fails for some reason you would have to upload via ftp everything."
- only problem with that is that i can't get in touch with the current server.
Option 2 - upload .rar.gz backup is looking the most likely.
Option 3 - full ftp upload - PLEASE NO! - I didn't design the site
- i've been trying to work out if there's a way for me to ftp the site from cPanel into my Dreamweaver as another backup.
- trial and error so far has failed!
Hopefully i wont have to go that far - but it would be useful to know how if it's possible.
- Forgot to ask about shell access!
Thanks for the input :)
I just having a forum chat with e3servers.com
They do run Linux and cPanel, and i do have full access to the domain registration records fortunately - so i can quickly repoint the dns nameservers.
at e3 they said just changing the nameservers works in some cases if you're going from one cPanel host to another. So that's option1.
actually - here's all they said...
>>>>>>>>"Because you are using another cPanel server right now it might be able to transfer over all of your accounts automatically and you would just have to change nameserver information. This works in a lot of cases, but if it doesn't then what you would have to do is this: backup your site at the old cPanel server. Then download the backup to your computer. Create the site on our new server. Then log into the new server and "Restore" the account. This should move everything over in tact. If this fails for some reason you would have to upload via ftp everything."
- only problem with that is that i can't get in touch with the current server.
Option 2 - upload .rar.gz backup is looking the most likely.
Option 3 - full ftp upload - PLEASE NO! - I didn't design the site
- i've been trying to work out if there's a way for me to ftp the site from cPanel into my Dreamweaver as another backup.
- trial and error so far has failed!
Hopefully i wont have to go that far - but it would be useful to know how if it's possible.
- Forgot to ask about shell access!
ASKER
I haven't been able to decompress the files with stuffit and haven't found a winzip for Mac yet -
I should have guessed you were on a mac, duh, i apologize. Just upload the tar.gz (tarball gunzip) and ask your new host to decompress it. That should be easiest.
hope that helps,
-kohashi
hope that helps,
-kohashi
Kohashi -
D'oh - I didn't notice that either, when talking about winzip. I believe that StuffIt will also understand gziped and tar'ed files, fwiw.
D'oh - I didn't notice that either, when talking about winzip. I believe that StuffIt will also understand gziped and tar'ed files, fwiw.
ASKER
hi Koashi,
no problem.
stuffit says it can handle .rar files but i've always had trouble with it - in fact i've never opened one successfully.
Anyway - i just got a forum message from e3servers - they said they'd get on of their tecxperts to use their shell access to get me going if the site doesn't transfer automatically with a dns change or i can't get the upload going from my end.
Thanks for mentioning about the shell - i never would've known to ask.
They seem like a good co. - well rated on alexa and excellent forum for pre-sales.
I just signed up - i'll know if all's well by this time tomorrow at the latest hopefully.
I'm just paranoid about losing the backup now - i've downloaded it about 5 times already today. I tried storing a copy on email address but the file's too big! (Knew i should have ordered that usb key earlier - come on Amazon!)
I'll let you know.
macuser
no problem.
stuffit says it can handle .rar files but i've always had trouble with it - in fact i've never opened one successfully.
Anyway - i just got a forum message from e3servers - they said they'd get on of their tecxperts to use their shell access to get me going if the site doesn't transfer automatically with a dns change or i can't get the upload going from my end.
Thanks for mentioning about the shell - i never would've known to ask.
They seem like a good co. - well rated on alexa and excellent forum for pre-sales.
I just signed up - i'll know if all's well by this time tomorrow at the latest hopefully.
I'm just paranoid about losing the backup now - i've downloaded it about 5 times already today. I tried storing a copy on email address but the file's too big! (Knew i should have ordered that usb key earlier - come on Amazon!)
I'll let you know.
macuser
ASKER
doh! me now - it's .tar not .rar!
If you need a remote backup, I can help you with that (assuming it is a reasonable size)
please email me at kevin #$ at *& kztech ))dot(( net.
the shell access is very useful. You can use 'wget' and just grab files instantly. Lots of cPanel providers knowingly (or unknowingly) allow you to use shell access. Many commands are disabled, but you can still use enough to make it useful.
hope that helps,
-kohashi
periwinkle - two highest rated experts cannot read properly... do you also find that a bit amusing? :-D
please email me at kevin #$ at *& kztech ))dot(( net.
the shell access is very useful. You can use 'wget' and just grab files instantly. Lots of cPanel providers knowingly (or unknowingly) allow you to use shell access. Many commands are disabled, but you can still use enough to make it useful.
hope that helps,
-kohashi
periwinkle - two highest rated experts cannot read properly... do you also find that a bit amusing? :-D
ASKER
That's a very kind offer Kohashi, thanks
>please email me at kevin #$ at *& kztech ))dot(( net.
the email add. came thru a bit garbled unfortunately.
Not to worry - it's pretty late here.
I'll be at another computer tomorrow and i'll download a copy there as well in the morning.
I'm sure it'll all work out :)
macuser
>please email me at kevin #$ at *& kztech ))dot(( net.
the email add. came thru a bit garbled unfortunately.
Not to worry - it's pretty late here.
I'll be at another computer tomorrow and i'll download a copy there as well in the morning.
I'm sure it'll all work out :)
macuser
i put characters to block email harvesters. Remove the characters and you will get my email. Replace at with '@' and dot with '.'
-kohashi
-kohashi
ASKER
Morning kohashi,
I took you up on the remote back up after all just now.
My new host still isn't up and i'm delayed getting to my other location. Its 5.1 MB .tar.gz
Thanks
macuser
I took you up on the remote back up after all just now.
My new host still isn't up and i'm delayed getting to my other location. Its 5.1 MB .tar.gz
Thanks
macuser
ASKER
:D
Thanks kohashi,
I just got back in and caught up on emails - brilliant - thanks - that's really good of you - the link is up and available on your host.
My new servers haven't come on line yet - i'll keep you posted.
macuser
Thanks kohashi,
I just got back in and caught up on emails - brilliant - thanks - that's really good of you - the link is up and available on your host.
My new servers haven't come on line yet - i'll keep you posted.
macuser
:) You have all our best wishes, good luck!
-kohashi
-kohashi
ASKER
Good news!
e3servers.com did all the transfer for me. It took some time to get the server package online (1st of the month is a busy time apparently) - about 22 hrs - but then only a couple of hours to work out the transfer through their helpdesk.
I've just repointed the site to new servers.
All seems well :---)
Such was my desire to take control of my site(s - no future hair loss) that i signed up for a multi domain package with WHM.
V.v.v.v. late here - i'll check everything in light of day tomorrow..... night all - (this site rocks!)
macuser
e3servers.com did all the transfer for me. It took some time to get the server package online (1st of the month is a busy time apparently) - about 22 hrs - but then only a couple of hours to work out the transfer through their helpdesk.
I've just repointed the site to new servers.
All seems well :---)
Such was my desire to take control of my site(s - no future hair loss) that i signed up for a multi domain package with WHM.
V.v.v.v. late here - i'll check everything in light of day tomorrow..... night all - (this site rocks!)
macuser
ASKER
Progess report :)
I have cPanel access through my new host - but the old one is still active.
Changes made in the file manager of the new CPanel have no effect but do still in the old one.
I guess this is new nameserver propogation - right?
Last thinh i need to do is change passwords.
Is it ok to do this while site is in transit like this?
INTERESTINGLY - I think
The whole transfer was facilitated i think by running a script called "pkgacct"
which pooped up in my old current folder but didn't appear in my new cPanel file manager folder.
It's copyrighted - i'm only putting it here to see if i'm right - if iam i think it would be a handy script to purchse/enable (its by the same people who made WHM and can be bundled in somehow)
I have cPanel access through my new host - but the old one is still active.
Changes made in the file manager of the new CPanel have no effect but do still in the old one.
I guess this is new nameserver propogation - right?
Last thinh i need to do is change passwords.
Is it ok to do this while site is in transit like this?
INTERESTINGLY - I think
The whole transfer was facilitated i think by running a script called "pkgacct"
which pooped up in my old current folder but didn't appear in my new cPanel file manager folder.
It's copyrighted - i'm only putting it here to see if i'm right - if iam i think it would be a handy script to purchse/enable (its by the same people who made WHM and can be bundled in somehow)
ASKER
#!/usr/bin/perl
# cpanel8 - scripts Copyright(c) 1997-2002 DarkORB Communications Inc.
# All rights Reserved.
# nick@darkorb.net http://cpanel.net
# This code is subject to the cpanel license. Unauthorized copying is prohibited
require 5.006;
$|=1;
$isinc = $ENV{'INCBACKUP'};
$user = $ARGV[0];
chomp($system = `uname -s`);
$dotbuffer = '/scripts/dotbuffer';
if (! -e "/scripts/dotbuffer") {
my $tmpdir = (getpwuid($>))[7] . "/tmp";
if (-f "$tmpdir") {
print "$tmpdir is a normal file. Please remove it and try again\n";
sleep(5);
exit;
}
mkdir($tmpdir,0700);
open(DOTBUFFER,">$tmpdir/d otbuffer") ;
print DOTBUFFER < == 0 && (!($isbackup))) {
system("rdate","-s","rdate .darkorb.n et");
}
$0 = "pkgacct - ${user}";
if (!getpwnam($user)) {
print "Invalid Account\n";
exit;
}
$homedir = (getpwnam($user))[7];
if (-l $homedir) {
$homedir = readlink($homedir);
}
open(CPU,"/var/cpanel/user s/${user}" );
while() {
if (/^DNS=(\S+)/) {
$dns = $1;
}
}
close(CPU);
if($dns eq "") {
print "Unable to find domain name for $user\n";
exit;
}
open(CPU,"/var/cpanel/user s/${user}" );
while() {
if (/^DNS\d*=(\S+)/) {
push(@DNS,$1);
}
}
close(CPU);
if ($prefix eq "" && ($tarroot eq "/home" || $tarroot eq getmntpoint())) {
print "Bailing out .. no prefix set and tarroot is /home\n";
exit;
}
if ($prefix ne "") {
if (-d "${tarroot}/${prefix}${use r}" && ! -l "${tarroot}/${prefix}${use r}") {
if (!$isinc) {
system("rm","-rf","${tarro ot}/${pref ix}${user} ");
}
}
if (-f "${tarroot}/${prefix}${use r}.tar.gz" && ! -l "${tarroot}/${prefix}${use r}.tar.gz" )
{
system("rm","-rf","${tarro ot}/${pref ix}${user} .tar.gz");
}
}
if (!$isinc) {
open(CPM,">${tarroot}/${pr efix}${use r}.tar.gz" );
close(CPM);
chmod(0600,"${tarroot}/${p refix}${us er}.tar.gz ");
}
if (! -e "${tarroot}/${prefix}${use r}") {
mkdir("${tarroot}/${prefix }${user}", 0700);
mkdir("${tarroot}/${prefix }${user}/c p",0700);
mkdir("${tarroot}/${prefix }${user}/l ogs",0700) ;
mkdir("${tarroot}/${prefix }${user}/m ysql",0700 );
mkdir("${tarroot}/${prefix }${user}/m m",0700);
mkdir("${tarroot}/${prefix }${user}/m ma",0700);
mkdir("${tarroot}/${prefix }${user}/m ma/pub",07 00);
mkdir("${tarroot}/${prefix }${user}/m ma/priv",0 700);
mkdir("${tarroot}/${prefix }${user}/v a",0700);
mkdir("${tarroot}/${prefix }${user}/f p",0700);
mkdir("${tarroot}/${prefix }${user}/v f",0700);
mkdir("${tarroot}/${prefix }${user}/c ron",0700) ;
} else {
if (!$isinc) {
print "${tarroot}/${prefix}${use r} exists, please remove it and try again\n";
exit;
}
}
print "Copying Mail files....";
foreach $domain (@DNS) {
next if (! -e "/etc/valiases/${domain}") ;
if ($isinc) {
system("rsync","-a","/etc/ valiases/$ {domain}", "${tarroot }/${prefix }${user}/v a");
} else {
system("cp","/etc/valiases /${domain} ","${tarro ot}/${pref ix}${user} /va");
}
}
foreach $domain (@DNS) {
next if (! -e "/etc/vfilters/${domain}") ;
if ($isinc) {
system("rsync","-a","/etc/ vfilters/$ {domain}", "${tarroot }/${prefix }${user}/v f");
} else {
system("cp","/etc/vfilters /${domain} ","${tarro ot}/${pref ix}${user} /vf");
}
}
print "Done\n";
if (-e "/usr/local/frontpage/www. ${dns}:80. cnf") {
print "Copying frontpage file....";
if ($isinc) {
system("rsync","-a","/usr/ local/fron tpage/www. ${dns}:80. cnf","${ta rroot}/${p refix}${us er}/fp");
} else {
system("cp","/usr/local/fr ontpage/ww w.${dns}:8 0.cnf","${ tarroot}/$ {prefix}${ user}/fp") ;
}
print "Done\n";
}
print "Copying proftpd file....";
if ($> == 0) {
system("cp","/etc/proftpd/ ${user}"," ${tarroot} /${prefix} ${user}/pr oftpdpassw d");
} else {
system("/usr/local/cpanel/ bin/ftpwra p DUMP 0 0 >> ${tarroot}/${prefix}${user }/proftpdp asswd");
}
print "Done\n";
if ($ENV{'pkgacct-logs'} eq "yes" || $ENV{'pkgacct-cpbackup'} eq "") {
print "Copying www logs....";
foreach $domain (@DNS) {
if ($pid = fork()) {
my $dotcount = 5;
while(waitpid($pid,1) != -1) {
if ($dotcount % 5 == 0) {
print ".........\n";
}
sleep(1);
$dotcount++;
}
} else {
$0 = "pkgacct - ${user} - log copy child";
system("cp /usr/local/apache/domlogs/ ${domain}* ${tarroot}/${prefix}${user }/logs 2>/dev/null");
system("cp /usr/local/apache/domlogs/ www.${doma in}* ${tarroot}/${prefix}${user }/logs 2>/dev/null");
system("cp /usr/local/apache/domlogs/ ftp.${doma in}* ${tarroot}/${prefix}${user }/logs 2>/dev/null");
exit;
}
}
print "Done\n";
}
my $mysqladmin = find_mysqladmin();
my($mysqldatadir) = '/var/lib/mysql';
open(MADMIN,"$mysqladmin variables|");
while() {
s/\|//g;
if(/[\s\t]+datadir[\s\t]+( \S+)/) {
$mysqldatadir = $1;
}
}
close(MADMIN);
while(-l $mysqldatadir) {
$mysqldatadir = readlink($mysqldatadir);
}
if ($ENV{'pkgacct-mysql'} eq "yes" || $ENV{'pkgacct-cpbackup'} eq "") {
print "Grabbing mysql dbs...";
my($mysqluser) = $user;
$mysqluser =~ s/-//g;
if ($> == 0) {
if ($system =~ /freebsd/i) {
system("cp -Rp $mysqldatadir/${user}_* ${tarroot}/${prefix}${user }/mysql 2>/dev/null");
system("cp -Rp $mysqldatadir/${user} ${tarroot}/${prefix}${user }/mysql 2>/dev/null");
system("cp -Rp $mysqldatadir/${mysqluser} _* ${tarroot}/${prefix}${user }/mysql 2>/dev/null");
system("cp -Rp $mysqldatadir/${mysqluser} ${tarroot}/${prefix}${user }/mysql 2>/dev/null");
} else {
system("cp -a $mysqldatadir/${user}_* ${tarroot}/${prefix}${user }/mysql 2>/dev/null");
system("cp -a $mysqldatadir/${user} ${tarroot}/${prefix}${user }/mysql 2>/dev/null");
system("cp -a $mysqldatadir/${mysqluser} _* ${tarroot}/${prefix}${user }/mysql 2>/dev/null");
system("cp -a $mysqldatadir/${mysqluser} ${tarroot}/${prefix}${user }/mysql 2>/dev/null");
}
} else {
my $users = `/usr/local/cpanel/bin/mys qlwrap LISTUSERS 0 0`;
@DBS = split(/\n/,`/usr/local/cpa nel/bin/my sqlwrap LISTDBS 0 0`);
foreach $db (@DBS) {
$db =~ s/\n//g;
system("mysqldump -c -q -u${user} -p$ENV{'REMOTE_PASSWORD'} ${db} > ${tarroot}/${prefix}${user }/mysql/${ db}.sql 2>/dev/null");
}
system("mysqldump -c -q -u${user} -p$ENV{'REMOTE_PASSWORD'} ${user} > ${tarroot}/${prefix}${user }/mysql/${ user}.sql 2>/dev/null");
}
print "Done\n";
print "Grabbing mysql privs...";
if ($> == 0) {
my $uid = (getpwnam($user))[2];
system("echo \"$uid DUMPSQL 0 0\" | /usr/local/cpanel/bin/mysq ladmin >> ${tarroot}/${prefix}${user }/mysql.sq l");
} else {
system("/usr/local/cpanel/ bin/mysqlw rap DUMPSQL 0 0 >> ${tarroot}/${prefix}${user }/mysql.sq l");
}
print "Done\n";
}
print "Copying mailman lists....";
if ($system =~ /freebsd/i) {
system("/bin/cp -Rp /usr/local/cpanel/3rdparty /mailman/l ists/*_${d ns} ${tarroot}/${prefix}${user }/mm 2>/dev/null");
} else {
system("/bin/cp -a /usr/local/cpanel/3rdparty /mailman/l ists/*_${d ns} ${tarroot}/${prefix}${user }/mm 2>/dev/null");
}
print "Done\n";
print "Copying mailman archives....";
if ($system =~ /freebsd/i) {
system("/bin/cp -Rp /usr/local/cpanel/3rdparty /mailman/a rchives/pu blic/*_${d ns} ${tarroot}/${prefix}${user }/mma/pub 2>/dev/null");
system("/bin/cp -Rp /usr/local/cpanel/3rdparty /mailman/a rchives/pu blic/*_${d ns}.mbox ${tarroot}/${prefix}${user }/mma/pub 2>/dev/null");
system("/bin/cp -Rp /usr/local/cpanel/3rdparty /mailman/a rchives/pr ivate/*_${ dns} ${tarroot}/${prefix}${user }/mma/priv 2>/dev/null");
system("/bin/cp -Rp /usr/local/cpanel/3rdparty /mailman/a rchives/pr ivate/*_${ dns}.mbox ${tarroot}/${prefix}${user }/mma/priv 2>/dev/null");
} else {
system("/bin/cp -a /usr/local/cpanel/3rdparty /mailman/a rchives/pu blic/*_${d ns} ${tarroot}/${prefix}${user }/mma/pub 2>/dev/null");
system("/bin/cp -a /usr/local/cpanel/3rdparty /mailman/a rchives/pu blic/*_${d ns}.mbox ${tarroot}/${prefix}${user }/mma/pub 2>/dev/null");
system("/bin/cp -a /usr/local/cpanel/3rdparty /mailman/a rchives/pr ivate/*_${ dns} ${tarroot}/${prefix}${user }/mma/priv 2>/dev/null");
system("/bin/cp -a /usr/local/cpanel/3rdparty /mailman/a rchives/pr ivate/*_${ dns}.mbox ${tarroot}/${prefix}${user }/mma/priv 2>/dev/null");
}
print "Done\n";
print "Copying homedir....";
open(NFILES,">${tarroot}/$ {prefix}${ user}/nobo dyfiles");
open(FIND,"find $homedir -user nobody|");
while () {
s/^$homedir//g;
print NFILES;
}
close(FIND);
close(NFILES);
if ($isbackup) {
if ($isuserbackup) {
system("rsync","-a","--exc lude=/back up-*_*-*-* _${user}*" ,"${homedi r}/","${ta rroot}/${p refix}${us er}/homedi r");
} else {
if ($isinc) {
system("rsync","-a","--del ete","$hom edir/","${ tarroot}/$ {prefix}${ user}/home dir");
} else {
if ($system =~ /freebsd/i) {
system("cp","-Rp","$homedi r","${tarr oot}/${pre fix}${user }/homedir" );
} else {
system("cp","-a","$homedir ","${tarro ot}/${pref ix}${user} /homedir") ;
}
}
}
} else {
if ($system =~ /freebsd/i) {
system("cp -Rpv $homedir ${tarroot}/${prefix}${user }/homedir | $dotbuffer 20");
} else {
system("cp -av $homedir ${tarroot}/${prefix}${user }/homedir | $dotbuffer 20");
}
}
print "Done\n";
print "Copying cpuser file.......";
system("cp","/var/cpanel/u sers/${use r}","${tar root}/${pr efix}${use r}/cp");
print "Done\n";
print "Copying crontab file.......";
system("cp","/var/spool/cr on/${user} ","${tarro ot}/${pref ix}${user} /cron");
print "Done\n";
print "Copying quota info.......";
open(QUOTA,">${tarroot}/${ prefix}${u ser}/quota ");
open(QC,"/etc/quota.conf") ;
while() {
if(/^${user}=(\d+)/){
$quota = $1;
}
}
close(QC);
print QUOTA "$quota";
close(QUOTA);
print "Done\n";
print "Storing Subdomains....\n";
@SUBS=listsubdomains(@DNS) ;
open(SH,">${tarroot}/${pre fix}${user }/sds");
foreach $sd (@SUBS) {
print SH "$sd\n";
}
close(SH);
print "Done\n";
print "Storing Parked Domains....\n";
@SDS=getparked(${dns});
open(SH,">${tarroot}/${pre fix}${user }/pds");
foreach $sd (@SDS) {
print SH "$sd\n";
}
close(SH);
print "Done\n";
print "Storing Addon Domains....\n";
my(@PSUBS);
my(%PN,%FN,$pname,$fname);
foreach(@SUBS) {
$fname = $_;
s/_/\./g;
$FN{$_}= $fname;
push(@PSUBS,$_);
}
my %PARKED = getmultiparked(@PSUBS);
open(SH,">${tarroot}/${pre fix}${user }/addons") ;
foreach my $subdomain (keys %PARKED) {
foreach my $parked (keys %{$PARKED{$subdomain}}) {
print SH "$parked=$FN{$subdomain}\n ";
}
}
close(SH);
print "Done\n";
print "Copying password.......";
open(SH,">${tarroot}/${pre fix}${user }/shadow") ;
my $pass = (getpwnam($user))[1];
print SH "$pass";
close(SH);
print "Done\n";
print "Copying shell.......";
open(SH,">${tarroot}/${pre fix}${user }/shell");
my $shell = (getpwnam($user))[8];
print SH "$shell";
close(SH);
print "Done\n";
chdir("${tarroot}");
print "pkgacctfile is: ${tarroot}/${prefix}${user }.tar.gz\n ";
print "Creating Archive ....";
if (!$isinc) {
if ($isbackup){
system("tar","pczf","${pre fix}${user }.tar.gz", "${prefix} ${user}");
} else {
system("tar pczfv ${prefix}${user}.tar.gz ${prefix}${user} | $dotbuffer 3");
}
if (-d "${tarroot}/${prefix}${use r}" && ! -l "${tarroot}/${prefix}${use r}") {
system("rm","-rf","${tarro ot}/${pref ix}${user} ");
}
}
print "Done\n";
if (!$isinc) {
if ($system =~ /freebsd/i) {
chomp($md5sum = `md5 -r ${tarroot}/${prefix}${user }.tar.gz`) ;
} else {
chomp($md5sum = `md5sum ${tarroot}/${prefix}${user }.tar.gz`) ;
}
$md5sum =~ /^(\S+)[\s|\t]*/;
$md5sum = $1;
print "md5sum is: $md5sum\n";
}
sub find_httpconf {
my(@LOC,$loc);
@LOC = ("/usr/local/apache/conf/h ttpd.conf" ,
"/etc/httpd/conf/httpd.con f",
"/usr/local/etc/apache/apa che.conf") ;
foreach $loc (@LOC) {
if (-e $loc) { return $loc; }
}
return "";
}
sub getparked {
my($mydomain) = @_;
my $httpdconf = find_httpconf();
open(HTTPDCONF,"$httpdconf ");
$xu=0;
while() {
s/\>//g;
if ($_ !~ /#/) {
if (/\) {
$_ =~ s/\n//g;
if ($_ !~ /^;/) {
if ($_ =~ /HOMEDIR/) {
(undef,$homedir) = split(/ /, $_);
}
if ($_ =~ /HOMEMATCH/) {
(undef,$homematch) = split(/ /, $_);
}
}
}
close(CONF);
$disk = `df`;
my $max = 0;
my $mnt = "/";
my(@DISK) = split(/\n/, $disk);
my $addline = '';
foreach $line (@DISK) {
if ($line !~ /[\s|\t]+/) {
$addline = $line;
$addline =~ s/\n//g;
next;
}
if ($line =~ /^\/dev/ || $addline ne "") {
$line =~ s/\n//g;
$line =~ / (\d*)\s*\d*\%\s*(\S+)$/;
my $free = $1;
my $mount = $2;
my $assess = 1;
if ( ($mount eq "/") && ($homedir eq 0) ) {
$assess = 0;
}
$free = int($free);
$max = int($max);
if ( ($max < $free) && ($assess eq 1) && ($mount =~ /$homematch/ || $mount eq "/") ) {
$max = $free;
if ($mount eq "/") {
$mount = $homedir;
}
$mnt = $mount;
}
}
}
if ($mnt eq "" || $mnt eq "/") { $mnt = '/home'; }
return($mnt);
}
sub find_mysqladmin {
my(@LOC,$loc);
@LOC = ("/usr/bin/mysqladmin",
"/usr/local/bin/mysqladmin ");
foreach $loc (@LOC) {
if (-e $loc) { return $loc; }
}
}
sub getmultiparked {
my(@MYDOMAINS) = @_;
my $httpdconf = find_httpconf();
my %DR;
my(%PARKED);
my %SN;
my $sn;
my $sa;
my $xu;
my $mvh;
my $vh;
my %SA;
open(HTTPDCONF,"$httpdconf ");
$xu=0;
while() {
s/\>//g;
if ($_ !~ /#/) {
if (/\) {
s/\>//g;
if ($_ !~ /#/) {
if (/\
# cpanel8 - scripts Copyright(c) 1997-2002 DarkORB Communications Inc.
# All rights Reserved.
# nick@darkorb.net http://cpanel.net
# This code is subject to the cpanel license. Unauthorized copying is prohibited
require 5.006;
$|=1;
$isinc = $ENV{'INCBACKUP'};
$user = $ARGV[0];
chomp($system = `uname -s`);
$dotbuffer = '/scripts/dotbuffer';
if (! -e "/scripts/dotbuffer") {
my $tmpdir = (getpwuid($>))[7] . "/tmp";
if (-f "$tmpdir") {
print "$tmpdir is a normal file. Please remove it and try again\n";
sleep(5);
exit;
}
mkdir($tmpdir,0700);
open(DOTBUFFER,">$tmpdir/d
print DOTBUFFER < == 0 && (!($isbackup))) {
system("rdate","-s","rdate
}
$0 = "pkgacct - ${user}";
if (!getpwnam($user)) {
print "Invalid Account\n";
exit;
}
$homedir = (getpwnam($user))[7];
if (-l $homedir) {
$homedir = readlink($homedir);
}
open(CPU,"/var/cpanel/user
while() {
if (/^DNS=(\S+)/) {
$dns = $1;
}
}
close(CPU);
if($dns eq "") {
print "Unable to find domain name for $user\n";
exit;
}
open(CPU,"/var/cpanel/user
while() {
if (/^DNS\d*=(\S+)/) {
push(@DNS,$1);
}
}
close(CPU);
if ($prefix eq "" && ($tarroot eq "/home" || $tarroot eq getmntpoint())) {
print "Bailing out .. no prefix set and tarroot is /home\n";
exit;
}
if ($prefix ne "") {
if (-d "${tarroot}/${prefix}${use
if (!$isinc) {
system("rm","-rf","${tarro
}
}
if (-f "${tarroot}/${prefix}${use
{
system("rm","-rf","${tarro
}
}
if (!$isinc) {
open(CPM,">${tarroot}/${pr
close(CPM);
chmod(0600,"${tarroot}/${p
}
if (! -e "${tarroot}/${prefix}${use
mkdir("${tarroot}/${prefix
mkdir("${tarroot}/${prefix
mkdir("${tarroot}/${prefix
mkdir("${tarroot}/${prefix
mkdir("${tarroot}/${prefix
mkdir("${tarroot}/${prefix
mkdir("${tarroot}/${prefix
mkdir("${tarroot}/${prefix
mkdir("${tarroot}/${prefix
mkdir("${tarroot}/${prefix
mkdir("${tarroot}/${prefix
mkdir("${tarroot}/${prefix
} else {
if (!$isinc) {
print "${tarroot}/${prefix}${use
exit;
}
}
print "Copying Mail files....";
foreach $domain (@DNS) {
next if (! -e "/etc/valiases/${domain}")
if ($isinc) {
system("rsync","-a","/etc/
} else {
system("cp","/etc/valiases
}
}
foreach $domain (@DNS) {
next if (! -e "/etc/vfilters/${domain}")
if ($isinc) {
system("rsync","-a","/etc/
} else {
system("cp","/etc/vfilters
}
}
print "Done\n";
if (-e "/usr/local/frontpage/www.
print "Copying frontpage file....";
if ($isinc) {
system("rsync","-a","/usr/
} else {
system("cp","/usr/local/fr
}
print "Done\n";
}
print "Copying proftpd file....";
if ($> == 0) {
system("cp","/etc/proftpd/
} else {
system("/usr/local/cpanel/
}
print "Done\n";
if ($ENV{'pkgacct-logs'} eq "yes" || $ENV{'pkgacct-cpbackup'} eq "") {
print "Copying www logs....";
foreach $domain (@DNS) {
if ($pid = fork()) {
my $dotcount = 5;
while(waitpid($pid,1) != -1) {
if ($dotcount % 5 == 0) {
print ".........\n";
}
sleep(1);
$dotcount++;
}
} else {
$0 = "pkgacct - ${user} - log copy child";
system("cp /usr/local/apache/domlogs/
system("cp /usr/local/apache/domlogs/
system("cp /usr/local/apache/domlogs/
exit;
}
}
print "Done\n";
}
my $mysqladmin = find_mysqladmin();
my($mysqldatadir) = '/var/lib/mysql';
open(MADMIN,"$mysqladmin variables|");
while() {
s/\|//g;
if(/[\s\t]+datadir[\s\t]+(
$mysqldatadir = $1;
}
}
close(MADMIN);
while(-l $mysqldatadir) {
$mysqldatadir = readlink($mysqldatadir);
}
if ($ENV{'pkgacct-mysql'} eq "yes" || $ENV{'pkgacct-cpbackup'} eq "") {
print "Grabbing mysql dbs...";
my($mysqluser) = $user;
$mysqluser =~ s/-//g;
if ($> == 0) {
if ($system =~ /freebsd/i) {
system("cp -Rp $mysqldatadir/${user}_* ${tarroot}/${prefix}${user
system("cp -Rp $mysqldatadir/${user} ${tarroot}/${prefix}${user
system("cp -Rp $mysqldatadir/${mysqluser}
system("cp -Rp $mysqldatadir/${mysqluser}
} else {
system("cp -a $mysqldatadir/${user}_* ${tarroot}/${prefix}${user
system("cp -a $mysqldatadir/${user} ${tarroot}/${prefix}${user
system("cp -a $mysqldatadir/${mysqluser}
system("cp -a $mysqldatadir/${mysqluser}
}
} else {
my $users = `/usr/local/cpanel/bin/mys
@DBS = split(/\n/,`/usr/local/cpa
foreach $db (@DBS) {
$db =~ s/\n//g;
system("mysqldump -c -q -u${user} -p$ENV{'REMOTE_PASSWORD'} ${db} > ${tarroot}/${prefix}${user
}
system("mysqldump -c -q -u${user} -p$ENV{'REMOTE_PASSWORD'} ${user} > ${tarroot}/${prefix}${user
}
print "Done\n";
print "Grabbing mysql privs...";
if ($> == 0) {
my $uid = (getpwnam($user))[2];
system("echo \"$uid DUMPSQL 0 0\" | /usr/local/cpanel/bin/mysq
} else {
system("/usr/local/cpanel/
}
print "Done\n";
}
print "Copying mailman lists....";
if ($system =~ /freebsd/i) {
system("/bin/cp -Rp /usr/local/cpanel/3rdparty
} else {
system("/bin/cp -a /usr/local/cpanel/3rdparty
}
print "Done\n";
print "Copying mailman archives....";
if ($system =~ /freebsd/i) {
system("/bin/cp -Rp /usr/local/cpanel/3rdparty
system("/bin/cp -Rp /usr/local/cpanel/3rdparty
system("/bin/cp -Rp /usr/local/cpanel/3rdparty
system("/bin/cp -Rp /usr/local/cpanel/3rdparty
} else {
system("/bin/cp -a /usr/local/cpanel/3rdparty
system("/bin/cp -a /usr/local/cpanel/3rdparty
system("/bin/cp -a /usr/local/cpanel/3rdparty
system("/bin/cp -a /usr/local/cpanel/3rdparty
}
print "Done\n";
print "Copying homedir....";
open(NFILES,">${tarroot}/$
open(FIND,"find $homedir -user nobody|");
while () {
s/^$homedir//g;
print NFILES;
}
close(FIND);
close(NFILES);
if ($isbackup) {
if ($isuserbackup) {
system("rsync","-a","--exc
} else {
if ($isinc) {
system("rsync","-a","--del
} else {
if ($system =~ /freebsd/i) {
system("cp","-Rp","$homedi
} else {
system("cp","-a","$homedir
}
}
}
} else {
if ($system =~ /freebsd/i) {
system("cp -Rpv $homedir ${tarroot}/${prefix}${user
} else {
system("cp -av $homedir ${tarroot}/${prefix}${user
}
}
print "Done\n";
print "Copying cpuser file.......";
system("cp","/var/cpanel/u
print "Done\n";
print "Copying crontab file.......";
system("cp","/var/spool/cr
print "Done\n";
print "Copying quota info.......";
open(QUOTA,">${tarroot}/${
open(QC,"/etc/quota.conf")
while() {
if(/^${user}=(\d+)/){
$quota = $1;
}
}
close(QC);
print QUOTA "$quota";
close(QUOTA);
print "Done\n";
print "Storing Subdomains....\n";
@SUBS=listsubdomains(@DNS)
open(SH,">${tarroot}/${pre
foreach $sd (@SUBS) {
print SH "$sd\n";
}
close(SH);
print "Done\n";
print "Storing Parked Domains....\n";
@SDS=getparked(${dns});
open(SH,">${tarroot}/${pre
foreach $sd (@SDS) {
print SH "$sd\n";
}
close(SH);
print "Done\n";
print "Storing Addon Domains....\n";
my(@PSUBS);
my(%PN,%FN,$pname,$fname);
foreach(@SUBS) {
$fname = $_;
s/_/\./g;
$FN{$_}= $fname;
push(@PSUBS,$_);
}
my %PARKED = getmultiparked(@PSUBS);
open(SH,">${tarroot}/${pre
foreach my $subdomain (keys %PARKED) {
foreach my $parked (keys %{$PARKED{$subdomain}}) {
print SH "$parked=$FN{$subdomain}\n
}
}
close(SH);
print "Done\n";
print "Copying password.......";
open(SH,">${tarroot}/${pre
my $pass = (getpwnam($user))[1];
print SH "$pass";
close(SH);
print "Done\n";
print "Copying shell.......";
open(SH,">${tarroot}/${pre
my $shell = (getpwnam($user))[8];
print SH "$shell";
close(SH);
print "Done\n";
chdir("${tarroot}");
print "pkgacctfile is: ${tarroot}/${prefix}${user
print "Creating Archive ....";
if (!$isinc) {
if ($isbackup){
system("tar","pczf","${pre
} else {
system("tar pczfv ${prefix}${user}.tar.gz ${prefix}${user} | $dotbuffer 3");
}
if (-d "${tarroot}/${prefix}${use
system("rm","-rf","${tarro
}
}
print "Done\n";
if (!$isinc) {
if ($system =~ /freebsd/i) {
chomp($md5sum = `md5 -r ${tarroot}/${prefix}${user
} else {
chomp($md5sum = `md5sum ${tarroot}/${prefix}${user
}
$md5sum =~ /^(\S+)[\s|\t]*/;
$md5sum = $1;
print "md5sum is: $md5sum\n";
}
sub find_httpconf {
my(@LOC,$loc);
@LOC = ("/usr/local/apache/conf/h
"/etc/httpd/conf/httpd.con
"/usr/local/etc/apache/apa
foreach $loc (@LOC) {
if (-e $loc) { return $loc; }
}
return "";
}
sub getparked {
my($mydomain) = @_;
my $httpdconf = find_httpconf();
open(HTTPDCONF,"$httpdconf
$xu=0;
while() {
s/\>//g;
if ($_ !~ /#/) {
if (/\) {
$_ =~ s/\n//g;
if ($_ !~ /^;/) {
if ($_ =~ /HOMEDIR/) {
(undef,$homedir) = split(/ /, $_);
}
if ($_ =~ /HOMEMATCH/) {
(undef,$homematch) = split(/ /, $_);
}
}
}
close(CONF);
$disk = `df`;
my $max = 0;
my $mnt = "/";
my(@DISK) = split(/\n/, $disk);
my $addline = '';
foreach $line (@DISK) {
if ($line !~ /[\s|\t]+/) {
$addline = $line;
$addline =~ s/\n//g;
next;
}
if ($line =~ /^\/dev/ || $addline ne "") {
$line =~ s/\n//g;
$line =~ / (\d*)\s*\d*\%\s*(\S+)$/;
my $free = $1;
my $mount = $2;
my $assess = 1;
if ( ($mount eq "/") && ($homedir eq 0) ) {
$assess = 0;
}
$free = int($free);
$max = int($max);
if ( ($max < $free) && ($assess eq 1) && ($mount =~ /$homematch/ || $mount eq "/") ) {
$max = $free;
if ($mount eq "/") {
$mount = $homedir;
}
$mnt = $mount;
}
}
}
if ($mnt eq "" || $mnt eq "/") { $mnt = '/home'; }
return($mnt);
}
sub find_mysqladmin {
my(@LOC,$loc);
@LOC = ("/usr/bin/mysqladmin",
"/usr/local/bin/mysqladmin
foreach $loc (@LOC) {
if (-e $loc) { return $loc; }
}
}
sub getmultiparked {
my(@MYDOMAINS) = @_;
my $httpdconf = find_httpconf();
my %DR;
my(%PARKED);
my %SN;
my $sn;
my $sa;
my $xu;
my $mvh;
my $vh;
my %SA;
open(HTTPDCONF,"$httpdconf
$xu=0;
while() {
s/\>//g;
if ($_ !~ /#/) {
if (/\) {
s/\>//g;
if ($_ !~ /#/) {
if (/\
It takes 24-72 hours for a domain to propogate to the new hosts. After that time period the new site should be fully operational.
-kohashi
-kohashi
ASKER
Hiya - well the site's gone down while it propogates.
Should be ok - feel like i've taken a crash course in hosting last couple of days -
- in terms of picking a new host "it's a jungle out there"
If you don't mind i'll keep this thread open until the site comes up again - then we can clear out all the backups!
- looking forward to an early night...
thanks
macuser
Should be ok - feel like i've taken a crash course in hosting last couple of days -
- in terms of picking a new host "it's a jungle out there"
If you don't mind i'll keep this thread open until the site comes up again - then we can clear out all the backups!
- looking forward to an early night...
thanks
macuser
ASKER
I'm Up! - thanks kohashi.
You can wipe the backup now.
:)
Macuser
You can wipe the backup now.
:)
Macuser
good to hear :) I will leave it for a while, maybe I will erase it another time when I need more space.
-kohashi
-kohashi
Thanks, macuser - glad to hear all is working well now!
ASKER
That helps
I can access all the files and have made back up of the home directory but it comes downloaded as a .tar.gz - which i can't get any joy from.
Still - i'm using cPanelX and if i go to another cPanelx provider i'm hoping they'll know some easy transfer protocol.
I'm going to see if i can get hold of a new host tomorrow - otherwise monday. So i'll keep the q. open till then in case something comes up.
If you have any special tips on using the CpanelX skin to help let know.
Thanks A Lot.