Parallels H-Sphere Documentation System Administrator Guide

 

Migrating Plans With XML

 
 

Related Docs:   Migrating Resellers and Users Into H-Sphere Creating Plan Wizards With XML (Developer Guide) Migrating Users into H-Sphere (before 2.5)

Last modified: 27 Dec 2007

 

WARNING: This documentation covers Parallels H-Sphere versions up to 3.1. For the latest up-to-date Parallels H-Sphere documentation, please proceed to the official Parallels site.

Plan settings are stored in XML format, which allows extracting and moving them to other locations.

Migratable Plans. Migratable plans include all non-reseller plans, namely: Unix, Windows, Admin, MySQL, E-Mail, Unix Real Server, Windows Real Media. All end user plans, including those of master admin and resellers, are migratable.

Migration Tools. Plans are migrated with two Java classes, PlanExtractor and PlanCreator, located in the ~cpanel/shiva/psoft/hsphere/migrator/ directory.

1) PlanExtractor is a Java utility to extract H-Sphere plans into XML format. Extracted plans are stored in the plans.xml file.

2) PlanCreator is a tool for importing plans to a new CP from the file plans.xml with plans extracted by PlanExtractor.

Also, you'll need to place the following files in the ~cpanel/shiva/psoft/hsphere/migrator/ directory:

  • plans.xml - XML-formatted information about plans extracted by PlanExtractor.
  • plans.dtd - DTD scheme for plans.xml.
  • migrate_plans.log - messages about errors occurred during plan extraction.

 

Plan Extractor

Log into CP server as cpanel and run PlanExtractor:

java psoft.hsphere.migrator.PlanExtractor [-force] -resellername res_name [-plans the list of plan names] [-ids the list of plan ids]

Options:

  • The -force option is used to ignore all possible errors while extracting plans.
  • The -resellername option requires the username of the reseller whose plans are extracted. To extract plans for master admin, use option -resellername admin.
  • The -plans option requires names of plans to be extracted for this reseller. If a plan name contains spaces, it must be quoted, e.g.:
    -plans Unix1 'Reseller 2' WinBest33
    If you omit both -plans and -ids, all plans will be extracted.
  • The -ids option requires IDs of plans to be extracted for this reseller. If you omit both -plans and -ids, all plans will be extracted.

Examples:

java psoft.hsphere.migrator.PlanExtractor -force -resellername RESELLER -plans silver 'unix gold'
java psoft.hsphere.migrator.PlanExtractor -force -resellername RESELLER -ids 7564 7675
java psoft.hsphere.migrator.PlanExtractor -force -resellername RESELLER
java psoft.hsphere.migrator.PlanExtractor -resellername admin -plans silver -resellername RESELLER -ids 7564

PlanExtractor writes error messages to migrate_plans.log.

 

Plan Creator

Run PlanCreator as cpanel with the following syntax:

java psoft.hsphere.migrator.PlanCreator [-active] -d plans.xml [-createprices]

Options:

  • -active - if possible, activate plans after they are created.
  • -d plans.xml - specify plan XML file to be taken.
  • -createprices - create prices for plans.

Make sure to restart H-Sphere after running PlanCreator.

PlanCreator writes error messages to migrate_plans.log.

 

XML Document Structure

The structure of plans.xml looks as follows:

                                 plans
                                  / ...
                              plan
                   ____________/\_________________________
                  /       |                               \
              periods  options                             \ ...
               / ...      | ...                   _________/\______________________________
           period        /|\                     /             |                  |        \
                   _____/ | \____          resource       ifresource           ifgroup  LogicalGroup
                  /       |      \             |               | ...              | ...
                 /        |       \            | ...         __|__             ___|___
                /         |        \           |            /     \           /       \
         customparam  postparam  param     ____|____   resource  ifgroup  resource  LogicalGroup
                                          /    |    \       |        | ...    |
                                     special fields price  ...    ___|___    ...
                                               | ...             /       \
                                            special         resource  LogicalGroup
                                                               |
                                                              ...

Example of plans.xml   |   DTD Scheme

 

XML Elements and Attributes

  1. plan - plan description:
    • name - plan name
    • reseller - reseller name (if not avaliable, admin is assumed)
    • wizard - wizard name
  2. period - plan periods:
    • id - period id
    • size - period duration
    • type - period type (DAY, WEEK, MONTH, YEAR)
    • discountusage - usage discount (%)
    • discountsetup - setup discount (%)
    • discountunit - recurrent discount (%)
  3. param - plan parameters used for the plan creation:
    • name - parameter name
    • value - parameter value

    Parameters:

    • trial - billing type: 0 - Without billing, 1 - Paid, 2 - Trial
    • trial_duration - trial period for the billing type trial
    • trial_credit - credit limit for the billing type trial
    • hard_credit - credit limit
    • send_invoice - enable e-mail invoice notification
    • mixedip - default IP type (shared or dedicated)
    • shared_ip_tag - shared IP Tag
    • calias - instant alias for the given shared IP tag
    • stopgapalias - stopgap domain for the given shared IP tag
    • money_back - enable money back
    • money_back_days - money back guarantee in days
    • periods - the number of plan periods
  4. postparam - parameters to be set after the plan creation:
    • name - parameter name
    • value - parameter value

    Parameters:

    • contactinfo - enable contact info
    • billinginfo - enable billing info
    • _template - default template
    • _TEMPLATES_DIR - template directory
  5. customparam - custom parameters to be set after the plan creation:
    • name - parameter name
    • value - parameter value
  6. resource - resources available for the plan.
    Check corresponding plan wizard XML documents in the ~cpanel/psoft/hsphere/plan/wizard/xml/ directory for the list of available resources and the way they are set:
    • name - resource name
    • enable - is resource enabled
    • include - is resource included
    • active - is resource activated
  7. price - resource price:
    • id - price id
    • freeunits - free units
    • setup - setup units
    • unit - monthly units
    • usage - extra units
  8. LogicalGroup - the plan's logical group:
    • name - logical group name
    • type - logical group type
    • groupid - logical group id
  9. special - special resource parameters:
    • name - special field name
    • value - special field value

Related Docs:   Migrating Resellers and Users Into H-Sphere Creating Plan Wizards With XML (Developer Guide) Migrating Users into H-Sphere (before 2.5)



© Copyright 2017. Parallels Holdings. All rights reserved.