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
