|
This document describes how to move virtual hosting accounts between H-Sphere
physical servers within the same H-Sphere cluster. Accounts can be moved either
between two Windows servers or between to Unix/Linux servers.
Account move implies:
1) transfer of
- user account
- all domains hosted under this account
- home directory and its content
2) IP and DNS data changes.
Account move doesn't involve user databases, as they are located on separate
database servers. Once you have correctly moved the accounts to a different web
server, user scripts will be able to work with MySQL databases from the new
location.
Warning: As a result of the account move, Webalizer statistics will be
reset. ModLogAn statistics won't be lost.
Requirements:
- There should not be any users on the target server with the same username as
on the source server.
- You need to have SSL certificates for all accounts using SSL. Since account
move doesn't work with accounts using SSL, you'll need to disable SSL for these
accounts before the move, and reinstall the certificates after the move.
- Port 873 (RSync) should be open
- The target server should have:
- shared IP with the same shared IP tag for migrated shared IP domains;
- free dedicated IP for migrated dedicated IP domains.
Procedures:
Account migration is carried out in two stages referred to in that document as
account creation and account content move. First, the command run
from the console creates identical account with an identical set of the migrated
account resources on the target server. This takes about 2 minutes per account.
Then the user account home directory content is copied to the target server from
the source server where it is stored for one more day and then automatically
deleted.
- Account creation
- Account content move
Account creation
Accounts can be created one by one or
in bunches.
Single account creation
- Disable SSL on all accounts where it is enabled.
- Log into the CP server as
cpanel
- Execute the following command:
java psoft.hsphere.tools.MoveVHostResources --accId ACCOUNT_ID --lserverId SERVER_ID
where
a) ACCOUNT_ID is an ID of the migrated account.
b) SERVER_ID is an ID of the target logical server.
- Restart H-Sphere
- Reinstall SSL certificates on all accounts where they had been installed.
Bunch account creation
- Create an XML file of the following structure:
<accounts>
<account id="ACCOUNT_ID1" serverId="SERVER_ID1"/>
<account id="ACCOUNT_ID2" serverId="SERVER_ID2"/>
<account id="ACCOUNT_ID3" serverId="SERVER_ID3"/>
................................
<account id="ACCOUNT_IDN" serverId="SERVER_IDN"/>
</accounts>
where
a) ACCOUNT_ID1-N is an ID of the account you are moving
b) SERVER_ID1-N is an ID of the logical server you are moving
accounts to.
- Disable SSL on all accounts where it is enabled.
- Log into your control panel server as root and execute:
chown cpanel:cpanel /hsphere/local/home/cpanel/accounts.xml
chmod 644 /hsphere/local/home/cpanel/accounts.xml
- Login as
cpanel
- Execute the following command:
java psoft.hsphere.tools.MoveVHostResources --config
/path/to/the/XML
where
/path/to/the/XML is a path to the XML file created in step 1.
- Restart control panel.
- Reinstall SSL certificates on all accounts where they had been installed.
When you run command either for single or bunch account creation,
the system checks if it can create identical account resources on the target
server. If any identical account resource cannot be created on the target server,
the system will inform you of it and won't migrate this account. If you are
migrating accounts in groups, the system will skip the account for which it
can't create identical set of resources. It will check the rest of the accounts
specifed in the XML file and start creating them on the target server.
In case there are accounts that can't be created on the target server, check
what prevents the system from creating identical set of resources on the target
server and try to run the command again.
Account content move
The second step of account migration implies the move of the user account home
directory and its content. Depending on account home directory size and connection
speed the content move may take a significant amount of time. The account home
directory can be moved either automatically or manually.
- Automatic content move
When account has been created, cron automatically initializes the content
move. By default every five minutes after account creation was intialized
cron checks if the account creation has been finished and then launches the
content move.
To change the default, open the
~cpanel/shiva/psoft_config/hsphere.properties file,
find the MOVING_CRON_PERIOD variable,
and set the different value. Values are set in minutes.
- Manual content move
If you don't want cron to launch content move automatically (e.g.: you
want to perform the content move at the time that best suits you), you need
to comment the MOVING_CRON_PERIOD variable in the H-Sphere
properties file. In this case the content move is initialized manually.
To launch the content move manually:
1. Log into your Control Panel as admin.
2. Go to Reports- > Content Move and retrieve the account
using the search utility.
* The Started entry will show "Not Started" for
accounts awaiting manual content move.
3. On the Search result page find the Controls section and click
the Launch icon.
Once the content move is over, user home directory on the source server remains
for one day and then is automatically deleted, including /etc/passwd, /etc/group,
/hsphere/local/home/[user id]. On Winboxes, user accounts need to be removed
manually, but this is fixed in H-Sphere 2.4.
To see if the content move is over:
1. Log into your Control Panel as admin.
2. Go to Reports- > Content Move and retrieve the account with
the search utility.
3. The Finished entry on the Search result page shows:
a) the time and the date when the account content move
was completed;
b) the time and the date when the account content move
was last suspended;
c) "Not finished" for accounts that their
content move hasn't been completed yet.
Content move suspension / resumption
Both automatically and manually launched content migrations can be suspended
and resumed at any time. You can suspend / resume the content move only for
individual accounts. No data is lost when you suspend the content move. When
resumed, the system starts migrating the rest of the content. Suspension /
resumption is valid only for uncompleted account content migrations.
To suspend / resume content migration:
1. Log into your Control Panel as admin.
2. Go to Reports- > Content Move and retrieve the account with
the search utility.
* Check the Only uncompleted box, to filter off all the
finished account migrations.
3. On the Search result page find the Controls section and click the
Suspend or Resume icon.
* Resumed automatic content move will be continued by cron while
resumed manual content move should be started by clicking the Launch
icon.
Content move cancellation
You can always cancel an uncompleted content move. The part of the
content that has been already moved to the target server by the time you
cancel the migration is not automatically deleted and should be deleted
manually. Besides when you cancel the content move no physical resources
created while account creation are removed, and if needed should be deleted
manually.
To cancel the content migration:
1. Log into your Control Panel as admin.
2. Go to Reports- > Content Move and retrieve the account with
the search utility.
* Check the Only uncompleted box, to filter off all the
finished account migrations.
3. On the Search result page find the Controls section and click the
Delete icon.
|