{"id":2882,"date":"2018-11-04T15:10:07","date_gmt":"2018-11-04T09:40:07","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=2882"},"modified":"2026-10-01T17:02:26","modified_gmt":"2026-10-01T11:32:26","slug":"how-to-migrate-cpanel-account-manually-from-backend","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-migrate-cpanel-account-manually-from-backend\/","title":{"rendered":"How to migrate CPanel Account manually from backend"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Post Date:<\/strong> November 4, 2018 <br><strong>Last Updated: <\/strong>October 01, 2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This guide explains how to manually migrate cPanel\/WHM accounts from one server to another using <code>pkgacct<\/code> and <code>restorepkg<\/code> \u2014 useful when you need direct control over the process, such as migrating before a license expires on the old server.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Before you start:<\/strong> Notify affected domain owners ahead of time. Email, databases, and files added during the transfer window may not carry over if the account is actively in use while you&#8217;re backing it up.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">One note on scope: for large, whole-server migrations, WHM&#8217;s built-in <strong>Transfer Tool<\/strong> (via a remote access key) is now the officially recommended method and handles a lot of this automatically. The manual steps below remain useful for single accounts, scripted bulk migrations, or when you need more direct control than the Transfer Tool offers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Root access to both the source and destination servers<\/li>\n\n\n\n<li>SSH connectivity between the two servers<\/li>\n\n\n\n<li>Enough free disk space on the destination server for the incoming accounts<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Architecture<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>pkgacct<\/code> packages a cPanel account&#8217;s files, email, databases, and configuration into a single <code>cpmove-*.tar.gz<\/code> archive<\/li>\n\n\n\n<li>That archive is transferred to the new server<\/li>\n\n\n\n<li><code>restorepkg<\/code> unpacks the archive and recreates the account on the destination server<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/ChatGPT-Image-Oct-1-2026-04_51_51-PM.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/ChatGPT-Image-Oct-1-2026-04_51_51-PM-1024x683.png\" alt=\"\" class=\"wp-image-12055\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/ChatGPT-Image-Oct-1-2026-04_51_51-PM-1024x683.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/ChatGPT-Image-Oct-1-2026-04_51_51-PM-300x200.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/ChatGPT-Image-Oct-1-2026-04_51_51-PM-768x512.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/ChatGPT-Image-Oct-1-2026-04_51_51-PM-272x182.png 272w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/ChatGPT-Image-Oct-1-2026-04_51_51-PM.png 1536w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Steps<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Back Up the Account(s) on Server 1<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>For a single account:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cd \/home\n\/scripts\/pkgacct accountname1\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> The original guide had <code>\/script\/pkgacct<\/code> (missing the &#8220;s&#8221;) \u2014 the correct cPanel scripts directory is <code>\/scripts\/<\/code>, as used correctly elsewhere in this same guide for <code>restorepkg<\/code>.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">This creates <code>cpmove-accountname1.tar.gz<\/code> in the current directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>For multiple accounts<\/strong>, generate a clean list of usernames first:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cat \/etc\/trueuserdomains | awk -F': ' '{print $2}' > \/root\/acctlist\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> The original used a <code>cut<\/code> command with two conflicting <code>-d<\/code> flags, which doesn&#8217;t reliably parse the <code>domain.tld: username<\/code> format in <code>\/etc\/trueuserdomains<\/code>. The <code>awk<\/code> command above splits on the actual <code>\": \"<\/code> separator correctly.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Then back up every account in that list, run inside <code>screen<\/code> so an interrupted SSH session doesn&#8217;t kill a long-running backup:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">screen\nfor i in $(cat \/root\/acctlist); do \/scripts\/pkgacct \"$i\"; done\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> The original loop (<code>for i in \\<\/code>cat \/root\/users.txt $i`;do \/script\/pkgacct $i; done;<code>) was malformed \u2014 it referenced <\/code>$i<code>inside the<\/code>cat<code>command itself, which makes no sense before<\/code>$i<code>is even defined. The corrected version above reads the account list first, then runs<\/code>pkgacct` once per account.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">2. Transfer the Archives to Server 2<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>For a single account:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">scp cpmove-accountname1.tar.gz root@&lt;server2_ip>:\/home\/\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> The original used <code>scp -rf<\/code>. <code>-r<\/code> (recursive) isn&#8217;t needed for a single file, and <code>-f<\/code> isn&#8217;t a flag meant for interactive use \u2014 it&#8217;s an internal protocol flag <code>scp<\/code> uses when operating in server mode behind the scenes, not something you should pass manually. Plain <code>scp<\/code> with no flags, as shown above, is correct here.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>For multiple accounts<\/strong>, transfer every archive plus the account list:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">scp cpmove-*.tar.gz root@&lt;server2_ip>:\/home\/\nscp \/root\/acctlist root@&lt;server2_ip>:\/root\/\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">For very large transfers, <code>rsync -avz<\/code> is often more reliable than <code>scp<\/code>, since it can resume an interrupted transfer rather than starting over.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">3. Restore the Account(s) on Server 2<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>For a single account:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cd \/home\n\/scripts\/restorepkg cpmove-accountname1.tar.gz\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>For multiple accounts<\/strong>, again run inside <code>screen<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">screen\nfor i in $(cat \/root\/acctlist); do \/scripts\/restorepkg \"$i\"; done\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4. Restoring Over an Existing Account (If Needed)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If an account with the same username already exists on the destination server, use one of these options instead:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/scripts\/restorepkg --force cpmove-accountname1\n\/scripts\/restorepkg --skipaccount cpmove-accountname1\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>--force<\/code> overwrites the existing account; <code>--skipaccount<\/code> skips recreating the account itself but still processes other parts of the restore. For the full list of <code>restorepkg<\/code> options, see cPanel&#8217;s <a href=\"https:\/\/docs.cpanel.net\/whm\/scripts\/the-restorepkg-script\/\" target=\"_blank\" rel=\"noopener\">current restorepkg documentation<\/a>.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> The original linked to an old cPanel version-68 documentation URL, which predates cPanel&#8217;s current documentation structure and is very likely broken by now. The link above points to cPanel&#8217;s current docs site.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Manually migrating cPanel accounts comes down to <code>pkgacct<\/code> on the source server, transferring the resulting archive, and <code>restorepkg<\/code> on the destination. For single accounts this is quick and direct; for bulk migrations, generating a clean account list with <code>awk<\/code> (not the original&#8217;s fragile <code>cut<\/code> command), running long loops inside <code>screen<\/code>, and double-checking every script path (<code>\/scripts\/<\/code>, not <code>\/script\/<\/code>) are what actually make the difference between a smooth migration and a broken one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Why did pkgacct fail with &#8220;command not found&#8221;?<\/strong> Almost certainly the <code>\/script\/<\/code> vs <code>\/scripts\/<\/code> typo \u2014 cPanel&#8217;s script directory is <code>\/scripts\/<\/code> (plural).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Should I use the manual method or WHM&#8217;s Transfer Tool?<\/strong> For a full server migration or many accounts at once, WHM&#8217;s built-in Transfer Tool is generally more reliable and officially supported. The manual method here is still useful for single accounts or when you need more granular control over the process.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What happens to email and databases during migration?<\/strong> <code>pkgacct<\/code> includes email accounts and databases in the archive by default, so <code>restorepkg<\/code> recreates them on the destination \u2014 just confirm this with a test account before relying on it for a full production migration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-install-whm-cpanel-on-ubuntu-20-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install WHM cPanel on Ubuntu 20.04<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-deploy-wordpress-behind-a-reverse-proxy-on-cpanel-apache\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Deploy WordPress Behind a Reverse Proxy on cPanel\/Apache<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to Our Technology Experts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Migrating servers or managing a cPanel\/WHM environment? Our team can help with server migrations, hosting infrastructure, and ongoing support.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/contact\">Connect with our technology experts.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post Date: November 4, 2018 Last Updated: October 01, 2026 Introduction This guide explains how to manually migrate cPanel\/WHM accounts [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1020],"tags":[249,473,360,474,466],"class_list":["post-2882","post","type-post","status-publish","format-standard","hentry","category-containers-kubernetes","tag-backend","tag-cpaenl","tag-migration","tag-scripts","tag-whm","psol-cat-containers-kubernetes"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-Ku","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2882","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=2882"}],"version-history":[{"count":2,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2882\/revisions"}],"predecessor-version":[{"id":12057,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2882\/revisions\/12057"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}