Using migrate-domain through API results in Success when it should fail

I've writing a script that will automate a lot of the work for migrating a domain from our Plesk server to Virtualmin, but have ran into a small problem. When running the remote API to import a client, if the username exists, the migration fails, but the status is still set to success. The best way to try this is to import a client using the remote API, and then to run it again after the first run finishes successfully. I know I can do the delete-existing option but in the off chance that Virtualmin tries to name the new username the same as an existing one, I don't want it to delete a completely separate site that might have a similar domain. Here is the code I use to test:


<?
$migratevs = shell_exec("wget -O - --quiet --http-user=root --http-passwd= --no-check-certificate 'https://domain.com.au:10000/virtual-server/remote.cgi?program=migrate-domain&sou
rce=/tmp/plesksourcefile.gz&type=plesk&xml=1'");
print_r($migratevs);
?>

And here is the XML response when it already exists:

Status: 
Closed (fixed)

Comments

Ok, I see the cause of this .. the failure of remote commands might not be detected when getting XML output in some cases.

I will fix this in the next Virtualmin release (3.77).

Hi Jamie, Thanks as always for the great support :). Can I ask when abouts it might be available? Looking at the previous releases, it looks like there is about one a month, but is there somewhere I can look at the development schedule to see when new releases will be coming out?

Brad

It will be a week or two. However, I can send you a pre-release version if you like ..

Hi Jamie, That would be most helpful as I am hoping to finish up the migration script I'm writing this week. My email address if you need it is brad dot mcnay at webarena dot com dot au. Thanks :)

Automatically closed -- issue fixed for 2 weeks with no activity.