undo express transfer redirects

rikkan

Registered
Mar 30, 2013
3
0
1
cPanel Access Level
Root Administrator
Hi

In the process of moving to a new server, i managed to screw things up badly enough that it required a reformat.

I used express transfer the first time round, and from testing one domain it appears that if i run it a 2nd time it will also copy the redirect contained in htaccess.

I was hoping there might be some way to magically remove this, either on the source or the destination server, as i really don't relish the prospect of having to dig through a few hundred domains by hand.

I found a page from 2010, but i think the info in it might be deprecated as /scripts/xfertool --help brings up nothing http://forums.cpanel.net/f145/whm-account-express-transfer-failback-164726.html

/usr/local/cpanel/scripts/xferpoint seams like it might be a likely replacement, but i wasn't able to work out the usage on it

any help would be much appreciated
 
Last edited:

gort42

Registered
Sep 1, 2007
4
0
51
I'd like to know more about any undo possibilities before I start migrations. I too have not found any great detail via google'ing.

FWIW, I'll probably use the normal transfer, shorten my DNS TTL or manually redirect , and rsync mail that may arrive during propagation. At least this will allow me to fallback trivially if there are transfer issues. Granted they are infrequent, but are a hassle when they occur.
 
Last edited:

rikkan

Registered
Mar 30, 2013
3
0
1
cPanel Access Level
Root Administrator
There apparently isn't an official way of doing it, but to be fair to cpanel it is a fairly contrived set of circumstances (express transfer to new server, reformat new server then transfer again)

The simple solution is simply not to check "express transfer" box, and the lazy one to create a set of backups immediately beforehand (probably not a bad idea anyway)

In the end one of the support people at cpanel took pity on me, as i can't send you a pm i've pasted their reply below. Please understand that this was completely unofficial and ymmv, but it worked perfectly for me (the script just comments out the spare redirects rather than getting rid of them).


The only way to undo this is to modify each accounts public_html/.htaccess file and the quickest would be to use a script. We don't generally provide help with scripting but here is a one liner that can be run and should modify each public_html/.htaccess file

for x in `ls /var/cpanel/users|grep -v \/`; do sed -i 's;^RedirectMatch \\.(dynamiccontent;#RedirectMatch \\.(dynamiccontent;' /home/$x/public_html/.htaccess; done
Please keep in mind this is being provided as an example and we won't be held responsible for the outcome of it's use. If you're not certain on he results of the one liner provided then we recommend obtaining assistance from a qualified systems administrator.
 
Last edited: