Migrating WordPress Sites with cPanel: Tips and Tricks Print

  • 0

Migrating a WordPress site can seem daunting, but using cPanel simplifies the process significantly. With the right approach and tools, you can ensure a seamless transition without losing data or functionality. This guide covers practical tips and tricks for migrating WordPress sites with cPanel.


1. Preparation Before Migration

Before starting the migration process, thorough preparation is essential. Here’s what you need:

Backup Your Existing Site

  • Use a WordPress plugin like UpdraftPlus or Duplicator to create a complete backup of your site, including files and the database.
  • Alternatively, download a full site backup from your current cPanel using the Backup Wizard.

Check Server Compatibility

  • Ensure the new hosting server meets WordPress requirements, such as PHP version, MySQL version, and disk space.

Access Credentials

  • Secure FTP/SFTP credentials for both old and new hosting accounts.
  • Database login credentials from the cPanel of the old server.

Maintain Current URLs

  • If you’re keeping the same domain name, ensure DNS changes are planned to minimize downtime.

2. Exporting Your WordPress Site

a. Export Files

  • Log in to your current cPanel.
  • Navigate to the File Manager and locate your WordPress installation (usually in the public_html folder).
  • Compress the WordPress files into a .zip archive and download them to your local machine.

b. Export Database

  • Go to phpMyAdmin in your cPanel.
  • Select your WordPress database and click on the Export tab.
  • Choose the Quick export method and save the .sql file to your computer.

3. Importing WordPress Files and Database

a. Upload Files to the New Server

  • Log in to the cPanel of the new hosting account.
  • Go to the File Manager, navigate to the public_html directory, and upload the .zip archive containing your WordPress files.
  • Extract the archive in the public_html folder.

b. Create a New Database

  • In cPanel, open the MySQL Database Wizard:
    • Create a new database.
    • Create a database user and assign it a strong password.
    • Grant all privileges to the user for the database.

c. Import Database

  • Open phpMyAdmin in the new cPanel.
  • Select the newly created database and click on the Import tab.
  • Choose the .sql file exported from the old server and upload it.

4. Configuring the WordPress Installation

Edit wp-config.php File

  • Locate the wp-config.php file in the WordPress root directory.
  • Update the following lines with the new database details:
    define('DB_NAME', 'new_database_name');
    define('DB_USER', 'new_database_user');
    define('DB_PASSWORD', 'new_database_password');
    define('DB_HOST', 'localhost');
    ​
  • Test the Configuration

    • Save the changes and visit your domain to verify the site is loading correctly.

    5. Updating DNS Records

    If your domain is registered elsewhere:

    • Log in to your domain registrar.
    • Update the nameservers to point to the new hosting provider.
    • DNS propagation may take up to 48 hours, but you can minimize downtime by lowering the TTL settings beforehand.

    6. Common Challenges and Troubleshooting

    Broken Links or Images

    • Cause: Incorrect file paths or URLs.
    • Solution: Use a plugin like Better Search Replace to update URLs in the database.

    500 Internal Server Error

    • Cause: Incorrect file permissions or corrupted .htaccess.
    • Solution: Set correct permissions (755 for directories, 644 for files) and regenerate .htaccess by saving WordPress permalinks.

    Error Establishing Database Connection

    • Cause: Incorrect database credentials in wp-config.php.
    • Solution: Double-check and correct the database name, username, and password.

    7. Tips for a Smooth Migration

    • Use Temporary URLs: If DNS propagation is still in progress, use the temporary URL provided by your new host to verify the migration.
    • Maintain Both Servers: Keep the old server active until propagation is complete.
    • Test Thoroughly: Check all website features, including forms, plugins, and media, after migration.
    • Use Migration Plugins: Tools like All-in-One WP Migration can simplify the process if you prefer an automated approach.

    8. Post-Migration Checklist

    • Verify SSL certificates and ensure the site is accessible over HTTPS.
    • Update any third-party integrations (e.g., email services, analytics).
    • Set up regular backups on the new server.
    • Monitor site performance to confirm the new hosting environment is optimized.

    Migrating WordPress sites with cPanel becomes straightforward with proper preparation and attention to detail. By following these tips and tricks, you can ensure a hassle-free migration with minimal downtime and a seamless transition for your visitors.


Was this answer helpful?

« Back