#### Migrating Data Using Chrooted Environment

You are advised to create a chrooted environment on a separate partition. This is required for you to be able to use this partition as a root file system upon completion of installing Plesk and migrating data to it. You must have super user permissions in order to configure the chrooted environment.

In order to create a chrooted environment, you will need at least 2 gigabytes of disk space for the operating system and Plesk installation, plus some amount of disk space for user data.

You can set up your system into a chrooted environment using the utility from the `chroot_tool.zip` package, which is available at ftp://download1.swsoft.com/Plesk/Plesk8.0/Extensions, or use other third-party utilities such as, for instance, mach (http://mach.sourceforge.net).

Important: We strongly recommend that you backup all the data on your hard drive prior to setting up chrooted environment.

To migrate data using chrooted environment:

1. Prior to installing Plesk, make sure that port 8443 is not used. If some program uses this port, you should reconfigure it so as to free the port.
2. Copy the Plesk installer file to the chrooted directory.
3. Enter the chrooted environment using the command `chroot <directory_name>`.
4. Define the value for variable CHROOTISH=yes.

   export CHROOTISH=yes

5. Configure mysql as follows:

   mysql_install_db

   chown -R mysql /var/lib/mysql/

6. Run mysql without networking.

   This can be done differently for different versions of MySQL. For instance, for MySQL version 3 this is done with the command '`safe_mysqld --skip-network &'`, and for version 4 the command is '`mysqld_safe --skip-networking &'`.

7. Run Plesk installer and follow the instructions presented on the screen.
8. Once Plesk installation is completed, log in to control panel, click the Server shortcut, then click the Migration Manager icon, and then click the Start Migration icon.
9. Specify your host as the data source, and proceed with migration as usual.
10. Once the migration is completed, you need to reboot server to start it from chroot partition.
11. Remove the "NO_RESTART_DAEMON" parameter from `/etc/psa/psa.conf` file.
12. Make sure that everything works correctly. In case of errors you can reboot to your previously used partition with other control panel.

To boot to the chrooted environment:

1. Add to the boot manager an item for booting up from the partition with chrooted environment.

   Example:

   Let's suppose you have Fedora Core 2 operating system and GRUB boot manager installed.

   1. Change to the `./boot/grub/` directory.
   2. Check out where your chrooted environment is set up using the command `fdisk -l`.

Disk /dev/sda: 2097 MB, 2097152000 bytes

128 heads, 32 sectors/track, 1000 cylinders

Units = cylinders of 4096 * 512 = 2097152 bytes

Device Boot Start End Blocks Id System

/dev/sda1 * 1 50 102384 83 Linux

/dev/sda2 51 919 1779712 83 Linux

/dev/sda3 920 1000 165888 82 Linux swap

Disk /dev/sdb: 2418 MB, 2418016256 bytes

255 heads, 63 sectors/track, 293 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/dev/sdb1 1 293 2353491 83 Linux

In our case it is the partition /dev/sdb1.

1. Open file `grub.conf` or `menu.list` in a text editor, and add the following records:

   title Fedora Core-chroot (2.6.5-1.358)

   root (hd1,0)

   kernel /boot/vmlinuz-2.6.5-1.358 ro root=/dev/sdb1

   initrd /boot/initrd-2.6.5-1.358.img

2. Save changes.

1. Create an initial ramdisk in the chrooted environment.

   Example for Fedora Core 2.

   Let's suppose you have chrooted environment set up in the directory `/disk2`.

   1. Enter the chroot using the command `chroot /disk2`.
   2. Remove the current image of initail ramdisk.

      ls /boot/

System.map-2.6.5-1.358

initrd-2.6.5-1.358.img

config-2.6.5-1.358

vmlinuz-2.6.5-1.358

rm -f /boot/initrd-2.6.5-1.358.img

1. Create new image of initail ramdisk:

   mkinitrd /boot/initrd-2.6.5-1.358.img 2.6.5-1.358

   Example for SuSe 9.1

   Let's suppose you have chrooted environment set up in the directory `/disk2`.

2. Enter the chroot using the command `chroot /disk2`.
3. Remove the current image of initail ramdisk using the command `mkinitrd`.

1. Restart your system.