• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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