The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Migration from H-Sphere to CPanel

Discussion in 'cPanel Developers' started by samuelaciego, Mar 1, 2010.

  1. samuelaciego

    samuelaciego Registered

    Joined:
    Mar 1, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    I’m working in a hsphere to cpanel migration project and my question is about how can I parse a xml file into cpanel, I want to create a xml file with all account information (username, domains, password, databases, etc) and then parse this file in cpanel for the account creation, is this possible ? how? or the only way is from whm and api's?

    Thanks in Advance
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Migration to cPanel

    Hi samuelaciego,

    One way to start your project would be to use the XMLAPI, (XML and JSON APIs). You could creating a script that parses your XML data into an API query; could use the createacct method and establish your accounts.

    If you're familiar with PHP, we have a convenience class XMLAPI.php found here
    Index of /lib/xmlapi/php

    Just grab the latest version and untar it. In there you'll find the class and some example scripts :)

    Importing databases/schema maybe a little more difficult. However, once you have the accounts created, I'm sure there's a few ways to get there. Caveat Emptor: cPanel, like many host management environments utilizes a 'username_' database naming convention. This should actually help you for the import, but future product versions may use a different user/db ownership paradigm...FYI

    I would consider utilizing the XMLAPI and performing a api1_query for db creation. Here is where the mysql api calls are documented: ApiMysql < ApiDocs < TWiki

    Once the db is created, it should be easy enough to perform a scripted mysql-import for the data itself. In this way, cPanel would handle db creation all the proper grants and you're only responsible for the data :). Again, it may take a little trial and error, but having the API do the heavy lifting is certainly the preferred method.


    Hope this gets you pointed in the right direction.

    -DavidN

    PS. you can use whatever method you wish to perform the API call, the PHP class is just one way ;)
     
  3. aiscom

    aiscom Registered

    Joined:
    Jan 20, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    We're looking for help (can pay) for moving 550+ domains from Hsphere to Enkompass. Anyone do that?
     
  4. Eric

    Eric Administrator
    Staff Member

    Joined:
    Nov 25, 2007
    Messages:
    746
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Texas
    cPanel Access Level:
    Root Administrator
    Howdy,

    At this time Enkompass has no migration tools for any platform. We will be releasing them in the future outside of the normal Enkompass release schedule.

    Thanks!
     

Share This Page