Question
I transferred an account(s) using the Transfer Tool with the Live Transfer option enabled. And I need to revert the changes that were made.
Answer
Live Transfers result in the suspending of accounts on the source server, services are proxied to the destination server, MX is redirected to the destination server, and DNS is also updated to the destination server.
To revert the changes made by Live Transfer, perform the following steps on the source server:
- Unsuspend the account. Use either of the following methods:
unuspendacct script.
Manage Account Suspension - Manually unset the service proxies using the unset_all_service_proxy_backends WHM API call:
whmapi1 unset_all_service_proxy_backends username=$username
- Remove the dynamic content blocks in .htaccess with the following command:
/scripts/xfertool --unblockdynamiccontent $username
- Remove the manual MX redirects that the Live Transfer option created. Run this command for every domain that used the Live Transfer option:
whmapi1 unset_manual_mx_redirects domain=domain.tld
- Update the DNS records to point back to the source server. Point the A records for any proxied accounts to the source server. Use one of the following methods:
- Run the swapip script using the following command and replace $oldIP, $newIP, and $ftpIP with the appropriate IP addresses.
cut -f1 -d":" /etc/trueuserdomains | while read x; do /usr/local/cpanel/bin/swapip $oldIP $newIP $ftpIP $x; done
The swapip Script - WHM’s DNS Zone manager interface (WHM » Home » DNS Functions » DNS Zone Manager).
DNS Zone Manager
If you need to run API calls on all accounts on the server, you can reference this article:
How to use a while loop in BASH to iterate over all cPanel users on a server
To unset service proxies for all accounts on the server, run this command:
cut -d":" -f1 /etc/trueuserowners | while read user;do whmapi1 unset_all_service_proxy_backends username=$user;done
To unset all domains that are having mail rerouted to a destination server, run the following command:
cut -f1 -d":" /etc/manualmx | while read domain;do echo; echo "Unsetting ManualMX for $domain";echo;whmapi1 unset_manual_mx_redirects domain=$domain;done