Migrate sites from cPanel to Plesk

Login to cPanel server and generate an SSH key. Run the following command in the terminal to generate the key.

ssh-keygen -b 2048 -t dsa -N “” -f /root/.ssh/id_dsa

The above command will write the key to the file /root/.ssh/id_dsa. Now login to the Plesk server and add the key into the file /root/.ssh/authorized_hosts. This will setup an SSH connection between the servers and you can now run rsync commands to migrate data over remote server.

Steps for cPanel to Plesk migration

1) Create an account in Plesk server. Also note down the DocumentRoot of the domain. By default, it would be /var/www/vhosts/domainname/httpdocs

2) Migrate files.

Run the below command from cPanel server

rsync -az –numeric-ids –progress /home/username/public_html root@$remote_ip:/var/www/vhosts/domainname/httpdocs

3) Migrate Databases.

– Take dumps of all databases using the below command.

mysqldump database_name>database_name.sql

– Copy the dump files to remote server.

scp database_name.sql root@Remote_IP:/var/www/vhosts/domainname/

– Login to plesk server and restore all databases.

mysqldump database_name<database_name.sql

4) Migrate email accounts.

– Setup email accounts on plesk server. Their default mail location will be /var/qmail/mailnames/example.com/username/Maildir. Now copy all mails using the below command.

rsync -az –numeric-ids –progress /home/username/mail/example.com/username root@$remote_ip:/var/qmail/mailnames/example.com/username/Maildir

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s