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:
Comments
Submitted by JamieCameron on Mon, 01/25/2010 - 23:49 Comment #1
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).
Submitted by brad.mcnay on Tue, 01/26/2010 - 16:16 Comment #2
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
Submitted by JamieCameron on Tue, 01/26/2010 - 16:23 Comment #3
It will be a week or two. However, I can send you a pre-release version if you like ..
Submitted by brad.mcnay on Tue, 01/26/2010 - 20:54 Comment #4
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 :)
Submitted by Issues on Tue, 02/09/2010 - 23:21 Comment #5
Automatically closed -- issue fixed for 2 weeks with no activity.