Parallels H-Sphere Documentation System Administrator Guide


Migrating Users from CPanel


Related Docs:   Migrating Users Into H-Sphere

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.

CPanel accounts can be migrated into H-Sphere be done with scripts that partly automate the procedure described in Migrating Users into H-Sphere The migration is carried out in two stages.

1. Create the accounts on the H-Sphere boxes corresponding to those that are to be migrated from CPanel. To do this, you need to:

1.1. Get CPanel users data and CPanel configuration data;
1.2. Put this user data in an xml file as described in Formatting User Data;
1.3. Create corresponding H-Sphere accounts (as in Creating Accounts) with the help of 'transferor's' Java program. This program uses the above mentioned xml file as a comand line parameter.

2. Transfer the web/mail/mysql content from CPanel (source) boxes to H-Sphere (destination) boxes. To do this, you need to:

2.1. Archive the web/mail content of the users to be migrated;
2.2. Transfer the archived data to the H-Sphere boxes;
2.3. Unpack the archived transferred content.

Throughout the whole process, you can use several scripts to prepare the xml file (step 1.2.) and transfer the web/mail/mysql_db content (steps 2.1., 2.2.). The scripts are launched through an interactive shell program.

  • Download the archived scripts from
  • Upload the archive to all the 'source' and 'destination' boxes. In case the mailservers are located on a separate box other than the web server, upload the scripts to this server, too.
  • Unpack the uploaded archive and launch the "" script from the newly created directory:
#tar xfz CPanel.tgz

#cd CPanel


You will see the following menu:

              1. Create XML file (source server)

              2. Prepare the content for downloading (source server)

              3. Download the content (destination server)

              4. Exit

Select the option relevant to the stage of your process.

Next, choose the accounts for migration. From the menu below, choose the appropriate option.

                1. Include all accounts;

                2. Include accounts from the range of accounts (alphabetic order);

                3. Include the list of accounts entered manually;

Now, let's take a closer look at each of the #./ script menu items:

1. Create XML file (source server)

The XML file is created on the CPanel server. Select item 1. In the interactive mode, enter "dns name/IP address" of the server where MySQL DB is located (localhost by default), user name (root by default) and the password to MySQL DB. The users.xml file will be created in the directory where the script is executed.

NOTE: the root password to MySQL DB can be found in the "/root/.my.cnf" file. To get the password, execute the following command:

#cat ~/.my.cnf

2. Prepare the content for downloading (source server)

Before you start preparing the content for archiving, you should fill in the requests by the data mentioned in the previous paragraph. Additionally, you will have to fill in the request for the creation of unix account on the source box. The archived content will be stored in its home directory. In case such account already exists, you'll have to indicate only the path to its home directory.

NOTE: With the help of the "df" unix utility you can check which of the unix partitions is the 'largest' and create there the home directory for the user. If the biggest partition size isn't big enough, you'll have to divide the data archivation and content transfer procedure into several steps. After each step you'll have to remove the already transferred content on the 'source' box to restore the disk space.

3. Download the content (destination server)

Download the content through this option of the script menu or using any Unix FTP client. As in the previous paragraphs, you will be prompted to fill in requests (MySQL DB info, path to the directory where archieved files are located, etc.)

NOTE 1: root password to MySQL DB can be found in the "~mysql/.my.cnf" file. To get the password, execute the following command:

#cat ~mysql/.my.cnf

NOTE 2: if the smtp server is located on a different box, you should archive the directory /path_to_archive_dir/mail and transfer this archive to respective 'destination' server. Find the menu for the unpacking the mail content and execute its items.

Related Docs:   Migrating Users Into H-Sphere

© Copyright 2017. Parallels Holdings. All rights reserved.