Migration of CPANEL accounts to H-Sphere can
be done with scripts that partly automate the procedure described
in Migrating Existing Users
to H-Sphere chapter of Admin Guide. The migration is carried
out in two stages.
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.
#tar xfz CPANEL.tgz
#cd CPANEL
#./cpanel_migrate.sh
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 #./cpanel_migrate.sh
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.