Paper Lantern for cPanel accounts is being retired this year. Find out more »
cPanel & WHM Version 102 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Better Transfer tool and bulk IP change features

Ryno Van Wyk shared this idea 4 months ago
Needs Review

When performing bulk migrations using the Transfer Tool in WHM and you need to do some domains Live and some cold it would be great if there was an option to paste in the list of domains instead of having to tick 400+ domains then when the live transfers are done you need to tick the remaining cold migration domains as their dedicated IPs need to transfer to the new server.

I usually select all then untick the cold domains but this , in some cases, is over 180 domains to untick which is very time consuming. The ability to import a list of domains via the transfer tool interface would be great. For example, download list of accounts from source server then filter in excel to only generate a list of domains using the server primary IP that can migrate live then paste the entire list in the transfer tool interface to auto select only those domains


Another issue thereafter is the cold accounts that need to retain their dedicated IPs or the domains that use external NS - once those are transferred to the new server I have to use the bulk IP change function and then use the drop down on each domain on the next screen which is also a pain - for this I use custom code to auto select the domains on the "Change Multiple Site`s IP Address" screen then modify the "var action = 0;" to "var action = 1;" on the next screen to change the IPs to the specified IP - if you could create a better bulk "import" domains with their IPs list for bulk "Change Multiple site`s IP Address" in the gui that would also save a lot of time for more complex migrations. Example of what I use in chrome console to auto select and change the IPs in "Change Multiple Site`s IP Address" and on the next screen I change: var action = 1: to auto select the IPs for all the domains to the IPs specified. Surely you can implement this in the GUI??


Use this formula in Excel to format the data to paste in console: =TEXTJOIN(,,"['",A2,"','",B2,"'],")

Assuming column A contains the domain name and B the IP address


let domains = [
//PASTE DOMAIN DATA FROM EXCEL HERE
['domain1.com','1.2.3.4'],
['domain2.com','3.4.5.6'],
['domain3.com','7.8.9.10'],
];

var action = 0;
// 0 = select domains, 1 = on fallowing page change ip's from dropdowns

function optionExists ( needle, haystack )
{
    var optionExists = false,
        optionsLength = haystack.length;

    while ( optionsLength-- )
    {
        if ( haystack.options[ optionsLength ].value === needle )
        {
            optionExists = true;
            break;
        }
    }
    return optionExists;
}

function check(array, value) {
    return array.some(entry => entry[0] === value);
}

if(action == 0){
document.querySelectorAll('#ipchg tbody tr').forEach(row => {
let domainName = row.querySelector('td:nth-child(2)').innerText;

if(check(domains,domainName)){
row.querySelector('td:nth-child(1) > input').checked = true;
};

});
}else if(action == 1) {

domains.forEach(domainData => {
    document.querySelectorAll('.simpleheading').forEach((domainTitle,index) => {

    let selectname = 'customip-'+(index+1);
    if((domainTitle.innerText).includes(domainData[0])){

if(optionExists(domainData[1],document.getElementsByName(selectname)[0])){
document.getElementsByName(selectname)[0].value = domainData[1];
}else {
console.log('IP '+domainData[1]+' for domain '+domainData[0]+' was not found in selection');
}
    }

Leave a Comment
 
Attach a file