• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Copy service plan between servers

Hi solucionesuno,

actually, there is no "easy" way ( yet ), to export/import service/hosting - plans. But you may vote for such a feature for the Plesk Control Panel at:



But you still have the choice to export a service/hosting - plan with the help of CLI - commands ( => service_plan: Hosting Plans ):

Example:
Code:
plesk bin service_plan -x "Unlimited"
... which results in an output in XML - format of your depending service/hosting - plan at your command line.

This XML - content can now be used to create a XML-RPC API request, with which you are able to create a new service plan on your 2. server.


 
A very dificult task.

I think that it is a featured normally needed by all people that work with more than one plesk server.

OK i find this examples:

GitHub - plesk/api-examples: Plesk API-RPC usage examples

And this documentation.

Creating a Service Plan

I am trying to do it with
Code:
REMOTE_HOST=your-plesk-host.dom REMOTE_LOGIN=admin REMOTE_PASSWORD=password ./example.sh

My Xml post is

Code:
<packet>
<service-plan>
   <add>
   <domain-service-plan owner-login="admin" name="BASICO">

<service-plan-item name="asp">false</service-plan-item>

<service-plan-item name="cgi">true</service-plan-item>

.......

And i get this response

Code:
<?xml version="1.0"?>
        <packet version="1.6.9.0">
                <system>
                        <status>error</status>
                        <errcode>1014</errcode>
                        <errtext>Parser error: Request is invalid. Error in line 4: Element 'domain-service-plan': This element is not expected. Expected is ( name ).</errtext>
                </system>       </packet>

seems that my xml post is not well formated.
 
the sheme exported with

Code:
plesk bin service_plan -x "Unlimited"

is total different by the sheme for API call to create the service plan, so I have to rewrite all the XML to be compatible? o_O

seems that the way to do is get the information service plan also via API

Getting Information on Service Plans
 
Last edited:
@solucionesuno I have the same challenge and am looking at using puppet with this. Either via wrapper scripts that use the cli output to pipe through the API or some other way.
 
Back
Top