• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Migration using RPC API

MerlijnH

Basic Pleskian
To start off, I have confirmed several times that migrating manually (using the web interface) works fine for the client/domain I am trying to migrate. However as I now want to automate the process I have been coding against the XML API to start the migration. I have basically generated a packet much like the Request samples and here's what I am sending (anonimized):

<packet version="1.6.0.2">
<migration>
<start>
<host>87.250.xxx.xxx</host>
<login>root</login>
<password>xxxxxxxxxxxxxxx</password>
<destination-host-directory>/home/migration</destination-host-directory>
<system-type>unix</system-type>
<selected-objects>
<migrate-clients>
<target-owner>admin</target-owner>
<client>
<name>someclientlogin</name>
<ip>
<old>
<ip-type>shared</ip-type>
<ip-address>87.250.xxx.xxx</ip-address>
</old>
<new>
<ip-type>shared</ip-type>
<ip-address>87.250.xxx.xxx</ip-address>
</new>
</ip>
<domain>
<name>somedomain.nl</name>
<ip>
<old>
<ip-type>shared</ip-type>
<ip-address>87.250.xxx.xxx</ip-address>
</old>
<new>
<ip-type>shared</ip-type>
<ip-address>87.250.xxx.xxx</ip-address>
</new>
</ip>
</domain>
</client>
</migrate-clients>
</selected-objects>
</start>
</migration>
</packet>

In this case the destination server is running Plesk 9.5.4 on Ubuntu and the source server is Plesk 8 on FreeBSD. The response the destination server gives is:

<?xml version="1.0"?>
<packet version="1.6.0.2">
<system>
<status>error</status>
<errcode>1029</errcode>
<errtext>Authentification method is not specified</errtext>
</system> </packet>

I have extensively looked at the documentation and example, and obviously googled the error code/message. I cannot seem to find any options that would allow me to set any method of authentication.

Is anyone able to shed some light on what I am missing here?

Thank you.
 
Yes, there is problem with authentication on 8.x Plesk version. I can suggest you to use following tested perl script for your API XML requests:

Code:
#!/usr/bin/perl 
 
use strict; 
use warnings; 
 
use Crypt::SSLeay;
use LWP::UserAgent;
 
use constant HOST => $ARGV[0]; 
use constant PORT => 8443; 
use constant PATH => "/enterprise/control/agent.php"; 
use constant LOGIN => "admin"; 
use constant PASSWD => $ARGV[1]; 
 
my $content = ''; 
while (<STDIN>) { 
$content .= $_ 
} 
 
my $userAgent = new LWP::UserAgent;
my $request = new HTTP::Request('POST' => 'https://' . HOST . ':' . PORT . PATH);
$request->content_type('text/xml');
$request->header(':HTTP_AUTH_LOGIN' => LOGIN);
$request->header(':HTTP_AUTH_PASSWD' => PASSWD);
$request->header(':HTTP_PRETTY_PRINT' => "TRUE");
$request->content($content);

my $response = $userAgent->request($request);
print $response->content();

You can use it with
# cat request.xml| ./script.pl IP_address admin's_password

It should work.
 
Back
Top