### **KB: Manual Domain Migration between cPanel Accounts** **Objective:** Move a functional website (files, database, and email) from a "Source" cPanel account to a "Destination" cPanel account. **Prerequisites:** * Access to both cPanel accounts. * No SSH access required. --- ### **Phase 1: Domain Setup (Destination cPanel)** Before moving data, the destination server must be configured to accept the new domain. * Log in to the **Destination cPanel**. * Navigate to the **Domains** section (often labeled "Domains" or "Addon Domains"). * Click **Create A New Domain**. * Enter the domain name you are migrating. * **Important:** Uncheck "Share document root" (if the option exists) so the domain has its own isolated directory. * Define the **Document Root** (e.g., `/public_html/example.com` or just `/example.com`) and click **Submit**. > > **Tip:** If the domain is still pointing to the old server via DNS, cPanel might verify ownership via a temporary file or fail validation. If it fails, ensure you can access the destination server's IP directly or temporarily adjust DNS. > --- ### **Phase 2: File Migration & Cleanup** **Step A: Source (Export)** * Log in to the **Source cPanel** and open the **File Manager**. * Navigate to the domain’s document root (usually `public_html` or a specific addon folder). * **Critical Settings Check:** Click **Settings** (top right) and ensure **"Show Hidden Files (dotfiles)"** is checked. This ensures you capture critical files like `.htaccess`. * **Select All** files. * Right-click and select **Compress** (Zip Archive). * Once compressed, select the `.zip` file and **Download** it to your local machine. **Step B: Destination (Import)** * Log in to the **Destination cPanel** and open **File Manager**. * Navigate to the **new Document Root** created in Phase 1. * Click **Upload** and select the `.zip` file you just downloaded. * Once the upload bar is green, go back to the File Manager window, click Reload, then right-click the `.zip` file, and select **Extract**. * **Path Correction:** If the files extracted into a sub-folder (e.g., `/example.com/example.com/`), enter that folder, **Select All**, and **Move** them up one level to the main document root. * **Cleanup:** Delete the `.zip` file from the server to save disk space. **Step C: .htaccess Cleanup (Crucial)** * Right-click the `.htaccess` file and select **Edit**. * **Remove Cache Rules:** Old caching plugins write hardcoded paths (e.g., `/home/old_user/...`) into this file that will crash the new site. * Delete any code blocks wrapped in comments like `# BEGIN W3TC Browser Cache`, `# BEGIN Litespeed`, or `# BEGIN WP Rocket`, this means remove everthing between the `# BEGIN` section to the matching `# END` below then **Save Changes**. --- ### **Phase 3: Database Migration** **Step A: Source (Export SQL)** * In the **Source cPanel**, open **phpMyAdmin**. * Select the database associated with the website, click the **Export** tab, and click **Go** (or **Export/Go**) to download the `.sql` dump file. **Step B: Destination (Create Database)** * In the **Destination cPanel**, open the **MySQL Database Wizard**. * **Step 1:** Create a new Database (give it a recognizable name). * **Step 2:** Create a new User. Generate a strong password and **copy it to a secure notepad** immediately. * **Step 3:** Assign the User to the Database and grant **All Privileges**. **Step C: Destination (Import SQL)** * Open **phpMyAdmin** in the **Destination cPanel**. * Select the *newly created* (empty) database from the left sidebar. * Click the **Import** tab, upload your `.sql` file, and click **Import/Go**. > > **Tip:** If the SQL file is larger than the upload limit in phpMyAdmin (often 50MB+), you may need to use the MySQL command line via SSH or request support to perform the import. > Example: `mysql -u database_user -p database_name < /path/to/filename.sql` Alternative (root user only): `mysql database_name < /path/to/filename.sql` --- ### **Phase 4: Configuration & Connection** You must now connect the files to the new database credentials. **Step A: Update Configuration File** * In the **Destination cPanel File Manager**, locate the configuration file (e.g., `wp-config.php` for WordPress, `.env` for Laravel, or `configuration.php` for Joomla). * Right-click and **Edit**. * Update the following lines with the *new* details created in Phase 3, Step B: * **DB_NAME / Database Name:** (e.g., `user_newdb`) * **DB_USER / Database User:** (e.g., `user_newuser`) * **DB_PASSWORD / Database Password:** (The password you generated). * **DB_HOST / Database Host:** Ensure this is set to `localhost`. * **Save Changes**. **Step B: WordPress Manager (Registering the Site)** *If this is a WordPress site, the destination cPanel doesn't "know" it exists yet.* * In **Destination cPanel**, open **WordPress Manager**. * Click the **Scan** button to search your directories for existing WordPress installations. * Once detected, click the "Down Arrow" icon next to the site to expand options and ensure the **Site URL** is correct. --- ### **Phase 5: Email Migration (History)** *Note: This method moves email history but requires you to manually recreate the email addresses first.* * **Step 1: Recreate Accounts:** In the **Destination cPanel**, go to **Email Accounts** and recreate the EXACT email addresses with their MATCHING passwords used on the old server. * **Step 2: Source Export:** * In **Source File Manager**, navigate to the `mail` folder. * Open the folder matching your domain name. * You will see folders for each user (e.g., `info`, `support`); compress the specific user folders you want to keep. * **Step 3: Destination Import:** * In **Destination File Manager**, navigate to `mail` -> `yourdomain.com`. * Upload and extract the zip file here. --- ### **Phase 6: Finalization & Performance** * **DNS:** Update your nameservers or A Record to point to the new host. * **SSL Generation:** Once DNS has propagated, log in to **Destination cPanel**, navigate to **SSL/TLS Status**, select the domain, and click **Run AutoSSL**. * **PHP Version Check:** Check the PHP Version in the Destination cPanel (**MultiPHP Manager**) and ensure it matches the version used on the Source. Mismatched PHP versions are the #1 cause of "Critical Errors" after migration. * **Caching Cleanup (WordPress):** * Log in to your WordPress Dashboard (`/wp-admin`). * **Deactivate and Delete** any old caching plugins (WP Rocket, W3 Total Cache, Autoptimize, etc.) to prevent conflicts. > > **Tip:** If you see "Mixed Content" errors or broken images after migration, install a plugin like **"Better Search Replace"** to find `/home/old_user/public_html` and replace it with `/home/new_user/public_html`. >