Our Community

DomainGurus Forums » Plesk Parallels Control Panel

How do I perform a disk-to-disk migration?

(1 post)
  1. How do I perform a disk-to-disk (chroot) migration?

    Plesk for Linux versions 8 and above support a disk-to-disk migration by exportingdata in a chroot shell and then importing it using the Plesk Migration Manager. (There is currently no method to perform a disk-to-disk migration on Plesk for Windows.If you have a Windows Plesk server, the only migration method is server-to-server. Youwill need to purchase a second server.)


      NOTE: This procedure requires you to login to your server via SSH and use thecommand line. You should be fairly comfortable with using the command lineof a Linux server prior to performing this procedure.

    Some directory or file locations my be different on your server. You will need to be able toassess your server's configuration and adjust the following instructions as necessary to fityour server's configuration.

    If you are NOT comfortable using the command line on a Linux server, you should consider one of the following options:

    1. Hire a qualified consultant with Linux experience to perform this procedure.2. Purchase a second server and perform a server-to-server migration instead. This can be completed entirely within the Plesk interface. Server-to-server Migration    using the Plesk Migration Manager from within the Plesk interface will yield identical results to this procedure

    DomainGurus is not responsible for data loss as a result of failure to completethis procedure correctly for your server and cannot recover any lost data. 

    This migration typically takes 2 hours or so to complete and performs a full migration of *ALL* Plesk related data including Plesk configuration, user accounts, mail boxes, Plesk-installed Web Applications, MySQL databases created from within Plesk, etcThis process may take longer than the above estimate. The actual time to completionwill vary, depending on the amount of data on your server. However this will result inmost complete and accurate migration possible.


      NOTE: The Plesk export should be completed in a screen session to avoid interruption of theexport process should your SSH session become disconnected for any reason. The screenutility allows your shell to continue even if your SSH session is disconnected.Use your distribution's package manager to install the "screen" utilityEX: Fedora/CentOSyum install screenMandrivaurpmi screenSuSEzypper install screenDebian/Ubuntuapt-get install screen To start a screen session, simply typescreenShould you become disconnected from your SSH session, you can reconnect to your previouslystarted session by typingscreen -rTo end your screen session, simply typeexitPlease review the man page for your distribution's screen utility for additional usage information.


    # These instructions assume that your old (slaved) disk is /dev/sdb. Depending on the# number of drives installed in your server, your old disk may not be /dev/sdb.# Replace /dev/sdb with the appropriate device name for your old (slaved) drive. # First be sure that your old disk is not mounted somewhere else. (Command is issued# twice, since /dev/sdb2 cannot be unmounted until other partitions are unmounted):

    umount /dev/sdb*
    umount /dev/sdb*

    # Make a mount point for the old drive under /mnt

    mkdir /mnt/old_disk

    # Mount old partitions in proper structure under /mnt/old_disk

    mount /dev/sdb2 /mnt/old_disk
    mount /dev/sdb3 /mnt/old_disk/var
    mount /dev/sdb6 /mnt/old_disk/home

    # Stop Plesk and all related services

    /etc/init.d/psa stopall

    # Create a migration directory on the old drive (preferably on the /home partition# since that partition has the most space) and copy the Migration Manager components# to the migration directory

    mkdir /mnt/old_disk/home/migration
    cp -r /usr/local/psa/PMM/agents/shared/* /mnt/old_disk/home/migration
    cp -r /usr/local/psa/PMM/agents/PleskX/* /mnt/old_disk/home/migration

    ## NOTE: Begin screen session described above## chroot to the old disk# (Directory "/mnt/old_disk" now becomes "/" for the current shell)

    export SHELL=/bin/bash
    chroot /mnt/old_disk

    # Start MySQL (Since you are chroot'ed to /mnt/old_disk, this will# start MySQL on your old drive and make that data available)

    /etc/init.d/mysqld start

    # NOTE: On SuSE and some other distributions, the MySQL process is simply named "mysql"# so you would simply enter# /etc/init.d/mysql start # cd to the migration directory and run run the PleskX.pl migration module create a dump# of your sites and data in Migration Manager format.

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

    # Once the export has completed, stop MySQL

    /etc/init.d/mysqld stop

    # Create a directory named "archive" and move all Migration Manager files to it# Move ONLY dump.xml back out

    mkdir /home/migration/archive
    mv /home/migration/* /home/migration/archive/
    mv /home/migration/archive/dump.xml /home/migration/

    # And exit the chroot environment

    exit

    ## NOTE: End screen session described above## Restart Plesk and related services (Since you are no longer in the chroot shell,# you are now starting Plesk on your new disk

    /etc/init.d/psa start

    # Now login to Plesk at https://<your-ip-address>:8443# and go to Server => Migration Manager => Start a new Migration## You will be prompted for the location of your data. Select Local Store, then select the# partition labeled /mnt/old_disk/home and then enter "migration" in the directory field.

    Posted 9 months ago #

Reply

You must log in to post.