Restoring Plesk domains from a slaved hard drive

If a manual transfer is required (for mail content, a complete server after a crash, database moving, etc.), refer to the following sources:

112699 How to restore a Plesk installation on the new server after a disaster
3072 How do I restore Plesk from the hard disk drive if the Operating System is broken and the HDD with the old OS and Plesk is mounted in the new system?
1152 How to migrate Plesk data manually with Plesk Migration Manager
6518 How to migrate local database between Plesk servers manually (applicable for versions 8.x and 9.x)
6158 How to migrate Сalendar, Personal Address Book, and Horde Webmail preferences manually
5882 How to migrate Plesk and SiteBuilder content and retain Plesk and SiteBuilder integration (applicable for versions 8.x and 9.x)

Steps

How do I restore Parallels Plesk from a hard disk drive if the Operating System is broken and the HDD with the old installation is mounted to the new server?

Plesk for Linux/Unix

I mounted the hard drive to a new Plesk server of the same version and want to transfer my Parallels Plesk data to the new server.

Resolution

The best way to do this is to make a Plesk backup using the PleskX.pl migration agent, then restore it on the new server. Follow the steps below:

Mount the old drive, for example to the “/restore” folder. If there are several partitions on the old drive (for example “/” and “/var”), they should all be mounted as they were in the old system (so that “/” is mounted to “/restore/” and “/var/” to “/restore/var/”). USe df to sewe the old drive:

# df -h
# mkdir /restore
# mount /dev/sdb3 /restore

Stop all Plesk services on the new system with this command:

# /etc/init.d/psa stopall

Create a new directory on the old drive and make sure it has the proper permissions (0755):

# mkdir /restore/migration
# chmod 0755 /restore/migration

Copy the migration agent to this location (after making sure there is enough free disk space to perform the dump):

# cp -r /usr/local/psa/PMM/agents/shared/* /usr/local/psa/PMM/agents/PleskX/* /restore/migration 

Ensure that the old drive mounted to “/restore/” has a “/dev” directory with all the required data. Otherwise, copy the data from “/dev” to “/restore/dev”:

# cp -rp /dev/* /restore/dev/

Chroot to the root folder of the old server (“/restore” in our case):

Chroot is an operation that changes the apparent root directory for the current running process and their children. A program that is run in such a modified environment cannot access files and commands outside that environmental directory tree. This modified environment is called a chroot jail.

# export SHELL=/bin/bash
# chroot /restore

Start MySQL from the old drive in the new chrooted environment:

# /etc/init.d/mysqld start 

Run the migration agent to make the Plesk dump:

# cd  /migration
 # chmod +x ./PleskX.pl
 # ./PleskX.pl --dump-all -v5

Exit from the chrooted shell after the dump process is finished…

# exit

and create an archive folder in the migration directory:


# mkdir /restore/migration/archives

Move all files except for dump.xml from “/restore/migration/” to the “/restore/migration/archive” folder.

# mv /restore/migration/* /restore/migration/archive

In Plesk 9.5 and older it is possible to import this data via the Plesk GUI. Go to Home > Migration Manager > Transfer data already processed by the migration agent and located on the local host and specify the dump.xml location (e.g. /restore/migration/dump.xml).

In Plesk 10 and newer the data is restored using the following command:


# /usr/local/psa/bin/pleskrestore --restore ./dump.xml -level server

Leave a Comment