{"id":3574,"date":"2019-02-07T17:46:40","date_gmt":"2019-02-07T12:16:40","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=3574"},"modified":"2026-10-07T14:12:59","modified_gmt":"2026-10-07T08:42:59","slug":"migrate-gsuite-mail-accounts-to-cpanel","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/migrate-gsuite-mail-accounts-to-cpanel\/","title":{"rendered":"How to Migrate Gmail or Google Workspace Email Accounts to cPanel"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Post Date:<\/strong> February 07, 2019<br><strong>Last Updated:<\/strong> October 07, 2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are situations where you may need to migrate email accounts from Google Workspace (formerly G Suite) to a cPanel-based mail hosting server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Using the <code>imapsync<\/code> tool, you can migrate existing emails from the Google Workspace IMAP server to the cPanel mail server while preserving the existing mailbox data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, we will explain how to migrate an email account from Google Workspace to cPanel using <code>imapsync<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting the migration, make sure you have the following information available.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Google Workspace Email Account<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You will need the source Google Workspace email account credentials:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Google Workspace email address<\/li>\n\n\n\n<li>Password or applicable authentication credentials<\/li>\n\n\n\n<li>IMAP access enabled<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">cPanel Email Account<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You will also need the destination mailbox details:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>cPanel email address<\/li>\n\n\n\n<li>cPanel email account password<\/li>\n\n\n\n<li>Destination mail server hostname<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Server Access<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You need SSH access with sufficient privileges to install and run <code>imapsync<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Install imapsync<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If <code>imapsync<\/code> is not already installed on the server, you can install it using:<\/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=\"\">sudo yum install imapsync\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The exact installation command may vary depending on the Linux distribution and repository configuration.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Create Password Files<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For better security, avoid placing email passwords directly in the <code>imapsync<\/code> command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create separate files for the source and destination mailbox passwords.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/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=\"\">\/etc\/secret1\n\/etc\/secret2\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Store the Google Workspace mailbox password in <code>\/etc\/secret1<\/code> and the cPanel mailbox password in <code>\/etc\/secret2<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure these files have appropriate permissions so that unauthorized users cannot access the stored credentials.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Start a Screen Session<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For larger mailboxes, migration can take some time. Running the migration inside a <code>screen<\/code> session allows the process to continue even if your SSH connection is interrupted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start a screen session:<\/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 -S mail_migration\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Run the Mail Migration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use the following <code>imapsync<\/code> command:<\/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=\"\">imapsync --host1 imap.gmail.com --port1 993 --ssl1 --user1 info@domain.com --passfile1 \/etc\/secret1 --host2 mail.domain.com --port2 993 --ssl2 --user2 info@domain.com --passfile2 \/etc\/secret2\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace the following values with your actual mailbox information:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>info@domain.com<\/code> \u2014 Source Google Workspace email account<\/li>\n\n\n\n<li><code>mail.domain.com<\/code> \u2014 cPanel mail server hostname<\/li>\n\n\n\n<li><code>\/etc\/secret1<\/code> \u2014 File containing the source mailbox password<\/li>\n\n\n\n<li><code>\/etc\/secret2<\/code> \u2014 File containing the destination mailbox password<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Verify the Migration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once <code>imapsync<\/code> completes, log in to the destination cPanel mailbox and verify that the required emails and folders have been migrated successfully.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For larger mailboxes, it is recommended to verify important folders such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Inbox<\/li>\n\n\n\n<li>Sent<\/li>\n\n\n\n<li>Drafts<\/li>\n\n\n\n<li>Archive<\/li>\n\n\n\n<li>Custom folders<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Enable IMAP Access<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The source mailbox must be accessible through IMAP for <code>imapsync<\/code> to retrieve the messages.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If IMAP access is disabled or restricted, enable the required access before starting the migration.<\/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> Google Workspace authentication and IMAP access requirements may vary depending on the organization&#8217;s security policies. Modern Google Workspace environments may require an appropriate authentication method rather than a basic username\/password login.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Migrating email accounts from Google Workspace to cPanel can be performed using <code>imapsync<\/code>, provided that both the source and destination mailboxes are accessible through IMAP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a successful migration, verify the source and destination credentials, configure IMAP access, protect mailbox credentials, and run the migration from a persistent terminal session such as <code>screen<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Always verify the migrated mailbox contents before decommissioning the original Google Workspace mailbox.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">What is imapsync?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>imapsync<\/code> is a mailbox migration tool that can synchronize email messages between IMAP-compatible mail servers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I migrate emails from Google Workspace to cPanel?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. If the Google Workspace mailbox and cPanel mailbox are accessible through IMAP, <code>imapsync<\/code> can be used to migrate the mailbox data.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Do I need IMAP access for the migration?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. <code>imapsync<\/code> relies on IMAP to access and transfer mailbox messages.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why should I use screen during migration?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Mailbox migrations can take a significant amount of time. Running the process inside a <code>screen<\/code> session helps prevent an SSH disconnection from terminating the migration process.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Where should I store the mailbox passwords?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The original example uses password files such as <code>\/etc\/secret1<\/code> and <code>\/etc\/secret2<\/code>. These files should be protected with restrictive permissions because they contain sensitive credentials.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Will the original Google Workspace mailbox be deleted?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. An <code>imapsync<\/code> migration copies or synchronizes mailbox data; it does not automatically delete the source mailbox. You should independently verify the destination mailbox before making any changes to the source environment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-enable-email-notifications-for-the-nagios-alerts\/\">How to enable email notifications for the Nagios alerts<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-export-import-emails-in-cpanel-webmail\/\">HOW TO EXPORT\/IMPORT EMAILS IN CPANEL WEBMAIL<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Need Help with Email Migration?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Need help migrating email accounts from Google Workspace or other mail servers to cPanel? Our team can assist with mailbox migration, IMAP configuration, DNS and mail server setup, authentication, troubleshooting, and post-migration verification. Get in touch with our team <a href=\"https:\/\/pheonixsolutions.com\/contact?utm_source=chatgpt.com\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post Date: February 07, 2019Last Updated: October 07, 2026 Introduction There are situations where you may need to migrate email [&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":[1019],"tags":[263,553,554],"class_list":["post-3574","post","type-post","status-publish","format-standard","hentry","category-cloud-aws","tag-cpanel","tag-gsuite","tag-mail-migration","psol-cat-cloud-aws"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-VE","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3574","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=3574"}],"version-history":[{"count":1,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3574\/revisions"}],"predecessor-version":[{"id":12155,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3574\/revisions\/12155"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=3574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=3574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=3574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}