Migrating from Plesk to cPanel via commandline

Rob —  June 19, 2013 — 1 Comment

If you’re anything like me, you prefer to do things via command line (CLI) rather than relying on a GUI to do most things in Linux. You also realize that while some of us don’t like to use control panels (plesk, cpanel, webmin, etc..), they are necessary when providing a shared hosting environment for your clients.


While cPanel has an excellent migration utility (and they’ll even migrate it for you for free in most cases), it will sometimes fail for one reason or another. If you do it via command line, you’ll be able to cut out some of those failures.

Here are the steps to migrate a customer from a plesk 8.x (yeah, pretty dated) box to a cpanel 11.3x box.

Info about our transfer:

  • Source server: plesk.company.com
  • Source account owner: siteuser
  • Destination server: cpanel.company.com

Source server (plesk)
1. SSH into the source server and become root
2. To find out the account owner, just see who owns the files in their /home/sites/domain.com directory.
3. cd into the home directory and run the pkgacct command calling the username that owns the account you want to xfer.

4. When that completes without error, move the file to the destination server using scp

Destination server (cpanel)
1. SSH into the destination server and become root
2. cd into /home and run the restorepkg command calling that same username to create the user and complete the migration

After this runs, you’ll see that everything for that user has now transferred over!

Things that are handy to know:
1. If the user’s account is huge, and perhaps there’s not enough room on the server, you can run the pkgacct command with –skiphomedir flag:

Things to check:

  1. Database names may now have different names on the cpanel server depending on your configuration. Instead of ‘databasename’ it may now be ‘siteuser_databasename’ or something similar.
  2. Run through the site – make sure all of the client’s pages come up how they’re supposed to – there may have been some special settings in the plesk php.ini or other configuration file that you’ll have to now do on the destination/cpanel server.

You’ll also feel better about yourself because you did it via command line, saved some time.. and can get on with something else now.

Related posts from Linux Brigade!

  • Search previous commands typedSearch previous commands typed If you want to see a collection of your previous commands used in Linux, you can always type ‘history’ for a listing of them. You can even search through history by grepping for the […]
  • Delete cPanel account error_log filesDelete cPanel account error_log files If you have a large number of accounts on your server, you may also be wasting a lot of space with the error_log files in each account. Some can get very large – and while you want to […]
  • Import MySQL database from command lineImport MySQL database from command line You’ll need to import a database via command line from time to time – I’ll normally opt for this anyway. After seeing how easy it is, you’ll probably end up using the command line instead […]
  • Globally disable directory listing on WHM/cPanelGlobally disable directory listing on WHM/cPanel One of the things that WHM/cPanel servers have on by default is directory listing. This is something you don’t want – but it’s easy to fix!

    1. Log into WHM
    2. Apache Configuration […]

  • Patch your WHM/cPanel machine for heartbleedPatch your WHM/cPanel machine for heartbleed You’ve certainly heard about Heartbleed by now. If not, you can read more about this vulnerability at Heartbleed.com. Continue reading this post to find out if you’re vulnerable, and how […]

Trackbacks and Pingbacks:

  1. Migrating from Plesk to cPanel via commandline | Webmaster Brigade - June 19, 2013

    […] We’ve moved this post to our Linux Blog:  http://www.linuxbrigade.com/migrating-from-plesk-to-cpanel-via-commandline/ […]

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url=""> 

*