Search

Language:  
Search for:

Available article translations:

Plesk Mass Transfer Script

APPLIES TO:
  • Parallels Plesk

Release notes

The Plesk Mass Transfer Script (formerly Mass Migration Script) is designed to allow providers transferring accounts from one Plesk farm to another one by an automated way.
 
Please feel free to discuss the script in the special thread on the Plesk Forum.

Plesk Mass Migration consists of 2 scripts:
- mmigration.php – designed to Plesk Mass Migration Script and
- run_mmigration.sh – can be used if destination Plesk server is running on the PVC container.
 
  • The mmigration.php script (attached) is designed to migrate one server.
The script does automate some routine like IP address mapping, conflict resolution and destination server initialization.
 
USAGE:

1. Download the script mmigration.php on the destination server.
2. Execute the script with following command:

On Linux:
# /usr/local/psa/bin/sw-engine-pleskrun mmigration.php -s <source_host> [-l <source_admin_login, by default 'root'>] -p <source_admin_password> [-P <ssh port, by default 22>]

The script will create migration sessions for each domain only if you run mmigration.php with '--per-domain' option. By default single migration session is created.
Created migration server can be found at the Parallels Plesk Control Panel -> Tools & Settings -> Migration Manager.

On Windows:
"%plesk_bin%\php.exe" -d auto_prepend_file="" mmigration.php
Options:
 
-s <host>            source host
-l <login>            login, default - Administrator
-p <passwd>     password
 
--per-domain     migrate per domain, default - all domains at once
--check                check for possible migration issues

NOTES:

- It calls pmmcli.py that is existing Plesk Migration Manager (PMM) backend tool.
- It implements a per-domain transferring algorithm that reduces disk space usage and memory consumption.
- IMPORTANT: If a domain with such name already exists on the destination server, domain's data will be overwritten.- PMM tool does not work with an SSH key, so root access is required.
- The script must be run on a destination server with Plesk, as well as the "psa-migration-manager" package, installed.
- The script has been verified to work with Plesk 10.4.4, but it will probably also work for all Plesk 9.x/10.x versions.
- Make sure that the destination server has enough number exclusive and shared IP address for the migrated domains.
- If destination Plesk server was not configured, admin's password from source Plesk server will be set.
- mmigration.php always sets SmartRestore="false" for MailEnable and SmarterMail to enable faster mail restoring via native provider, which has been fully implemented since 11.0.9 MU #37 as described in KB article http://kb.sp.parallels.com/114489

  • For migration to fresh installed and not configured Plesk server you should:
1. Run the following command on the destination server:
# /usr/local/psa/bin/ipmanage --reread

Note: If you add IP using 'ipmanage --create', it's not required to run 'ipmanage --reread'. If you add IP using ifconfig or from VZ node using vzctl, order of operations is reverse: at first you add IP, at second you reread IPs using 'ipmanage --reread'
If you reread IPs using 'ipmanage --reread', you should set proper IP types after this.

2. After that you can add IP addresses:
# /usr/local/psa/bin/ipmanage --create 123.123.123.125 -type exclusive -mask 16 -interface eth0
# /usr/local/psa/bin/ipmanage --create 123.123.123.124 -type shared -mask 16 -interface eth0

3. Also it is necessary to install license key via CLI or API RPC:

CLI:
# /usr/local/psa/admin/bin/keymng --install --source-file license_key.xml
API-RPC:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.0.2">
<server>
<lic_install>
<license>
.... licence key encoded in base64 ...
</license>
</lic_install>
</server>
</packet>


  • If you are going to migrate domains to the Parallels Plesk Panel for Linux installed inside PVC container, please use the script the run_mmigraiton.sh script (attached).

It is designed to launch the mmigration.php to perform batch-transferring from one Parallels Plesk Panel server to the PVC container.
 

Also we provide the following step-by-step migration scenario using run_mmigration.sh:
 
1. Get latest run_mmigration.sh and mmigration.php
2. Set root password on source Virtuozzo Container if it's unknown.
3. Install license on destination
Virtuozzo Container using
# /usr/local/psa/bin/license -i <license_file>

4. Check number of IPs and its types on source Virtuozzo Container as
select ip_address, type from IP_Addresses;
(for Plesk 8)
or
select i.ip_address, p.type from IP_Addresses i inner join ip_pool on i.id = p.ip_address_id;
(for Plesk 9 and later).
5. Add required number of IPs on destination Virtuozzo Container.
6. Run

# /usr/local/psa/bin/ipmanage --reread
on destination Virtuozzo Container.
7. Set types for IPs on destination
Virtuozzo Container as on source Virtuozzo Container using
# /usr/local/psa/bin/ipmanage -u <IP> -type shared/exclusive
because new IPs added after "--reread" are exclusive by default.
8. Check diskspace on destination Virtuozzo Container comparing to content on source Virtuozzo Container and increase it if necessary.
9. Run migration as:
# ./run_migration.sh <source_IP> root <source_passwd> <VEID> 2>&1 | tee mm.log

 

USAGE for Virtuozzo Containers for Linux:

You can use it with the following command:

./run_mmigration.sh <destination_VEID> [--save-logs] MMIGRATION_OPTIONS

--save-logs                 save logs to current directory
--save-logs <dir>       save logs to <dir>
 
MMIGRATION_OPTIONS:
 
-s <host>               source host
-l <login>                login, default - root
-p <passwd>         password
-P <port>               SSH port, default - 22
 
--per-domain         migrate per domain, default - all domains at once
--check                   check for possible migration issues
 
 
In short:
./run_mmigration.sh <destination_VEID> [--save-logs [<logs_dir>]] -s <source_server> -p <passwd> [-l <login>]
For example:
./run_mmigration.sh 100 --save-logs -s 192.168.0.100 -p password

Mass Migration Best Practice

  • 113586 Parallels Plesk Panel for Linux: Migration Best Practices and Usecases
  • 113590 Parallels Plesk Panel for Windows: Migration Best Practices and Usecases


Attachments:


c81e59b61af9dca603ba03b14aabe968 56797cefb1efc9130f7c48a7d1db0f0c

FEEDBACK
Was this article helpful?
Tell us how we may improve it.
Yes No
 
 
 
 
 
 
Server Virtualization
- Parallels Cloud Server
- Parallels Containers for Windows 6.0
- Parallels Virtuozzo Containers
Automation
- Parallels Automation
- Parallels Automation for Cloud Infrastructure
- Parallels Business Automation Standard
- Parallels Virtual Automation
- Parallels Plesk Panel Suite
- Web Presence Builder
- Parallels Plesk Automation
- Parallels Small Business Panel
- Value-added Services for Hosters
- Parallels Partner Storefront
Services & Resources
- Cloud Acceleration Services
- Professional Services
- Support Services
- Training & Certification