Troubleshooting cPanel & WordPress Migration: Fixing Common Issues for Nepali Startups
Migrating a website, especially for a growing startup in Kathmandu or Pokhara, can be daunting. This guide helps Nepali startups troubleshoot common cPanel and WordPress migration issues, ensuring a smooth transition with minimal downtime.
Key facts: * Migration Complexity: Even with cPanel's tools, manual intervention is often needed for WordPress. * Downtime Risk: Improper DNS cutover or backup issues can lead to significant service interruption. * Common Errors: Database connection problems, broken permalinks, and email configuration are frequent. * Nepal Specifics: Consider local payment gateways like Khalti and eSewa, and .np domain nuances.
Overview of Common Migration Challenges
Website migration, particularly when moving a WordPress site between cPanel hosting providers, can introduce a range of unexpected problems. For Nepali startups, ensuring continuous service for users and payment gateways (like Khalti and eSewa) is critical. While cPanel offers robust backup and restore functionalities, WordPress's dynamic nature, with its database-driven content and complex permalink structures, often requires extra attention. Issues can arise from incorrect file permissions, database connection strings, outdated plugins, or improper DNS (Domain Name System) settings.
According to a 2025 survey by a local tech consultancy, nearly 40% of Nepali startups reported experiencing some form of downtime or data inconsistency during their last website migration. This highlights the importance of thorough planning, meticulous execution, and knowing how to troubleshoot effectively.
Why Migrations Go Wrong
Migrations often fail due to a combination of factors:
* Incomplete Backups: Not all files or database tables are included in the backup. * Incorrect Configuration: Database credentials, file paths, or WordPress settings (like site URL) are wrong. * DNS Propagation Delays: The time it takes for new DNS records to update globally can cause temporary site unavailability. * Plugin/Theme Incompatibilities: Issues with plugins or themes not functioning correctly on the new server environment. * Server Environment Differences: Variations in PHP versions, Apache/Nginx configurations, or security settings between old and new hosts.
Step-by-Step Troubleshooting Guide
When your WordPress site isn't working as expected after a cPanel migration, a systematic approach is key. Here's how to tackle the most frequent problems.
1. DNS Propagation and Caching Issues
Problem: Your site shows the old content, an error, or doesn't load at all after updating nameservers or A records.
Solution: DNS changes can take 24-48 hours to fully propagate across the internet. During this period, some users might see the old site, while others see the new one, or nothing at all. Your local internet service provider (ISP) in Nepal, such as WorldLink, Vianet, or Classic Tech, might also cache old DNS records.
* Verify DNS Records: Use online tools like whatsmydns.net to check if your domain's A record points to the new server's IP address globally. Ensure your nameservers are correctly updated at your domain registrar (e.g., Mercantile Communications for .np domains).
* Clear Local DNS Cache: On Windows, open Command Prompt and run ipconfig /flushdns. On macOS, use sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder in Terminal.
* Clear Browser Cache: Often overlooked, your browser might be showing a cached version of your site.
2. Database Connection Errors
Problem: You see "Error establishing a database connection" on your WordPress site.
Solution: This is one of the most common WordPress errors after migration. It means WordPress cannot connect to its database.
* Check wp-config.php: Open wp-config.php in your WordPress root directory. Verify DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST are correct for the new cPanel environment. DB_HOST is usually localhost, but some hosts might use a specific IP or hostname.
* Verify Database and User in cPanel: Log into your new cPanel. Go to "MySQL Databases" and ensure the database, database user, and their associated password exist and are correctly linked with all privileges.
* Import Database Correctly: Confirm the database was fully imported. Check the database size and table count in phpMyAdmin on the new server against the old one.
3. Broken Permalinks and 404 Errors
Problem: Your homepage loads, but clicking on any links results in a 404 "Page Not Found" error.
Solution: This typically happens when the .htaccess file is missing or corrupted, or WordPress's permalink structure needs to be refreshed.
* Resave Permalinks: Log into your WordPress admin dashboard (if you can access it). Go to "Settings" > "Permalinks" and simply click "Save Changes" without making any modifications. This regenerates the .htaccess file.
* Check .htaccess File: Using cPanel's File Manager, navigate to your WordPress root directory. Ensure a .htaccess file exists and has the correct WordPress rewrite rules. If it's missing or incorrect, you can create a new one with the standard WordPress rules:
``
# BEGIN WordPress
`
4. Incorrect Site URL and Redirect Loops
Problem: Your site redirects to the old domain, or you're stuck in a redirect loop.
Solution: WordPress stores its site URL in the database. If this isn't updated, it can cause issues.
Update Site URL in wp-config.php (Temporary): Add these lines to your wp-config.php file above the / That's all, stop editing! Happy publishing. */ line. Replace yourdomain.com with your actual domain.
`php
define('WP_HOME','https://yourdomain.com');
define('WP_SITEURL','https://yourdomain.com');
`
Remember to remove these lines once you've successfully logged into your WordPress admin and updated the URLs via the General Settings.
* Update Site URL in Database (Permanent): If you can't access the admin, use phpMyAdmin. Go to your WordPress database, find the wp_options table (or yourprefix_options), and edit the siteurl and home rows to your new domain.
5. Email Configuration Issues
Problem: Emails sent from WordPress (contact forms, notifications) are not being delivered, or your custom domain emails aren't working.
Solution: Email settings are separate from website files. You need to configure them on the new cPanel.
* Recreate Email Accounts: In your new cPanel, go to "Email Accounts" and recreate all necessary email addresses (e.g., [email protected]).
* Update MX Records: Ensure your domain's MX (Mail Exchange) records point to your new hosting provider's mail servers. This is done through the "Zone Editor" in cPanel or your domain registrar's DNS management interface. For local ISPs like Subisu, these might need explicit configuration.
* Test SMTP Settings: For WordPress to send emails reliably, consider using an SMTP (Simple Mail Transfer Protocol) plugin and configure it with your new email account credentials. This bypasses PHP mail and often improves deliverability.
Advanced Troubleshooting & Best Practices
Beyond the common issues, some situations require a deeper dive. For complex WordPress migration scenarios, especially those involving custom code or large databases, consider specialized tools or professional help.
Checking Server Logs
cPanel provides access to various server logs that can offer clues:
* Apache Error Logs: Found under "Metrics" > "Errors" in cPanel. Look for PHP errors, file permission issues, or .htaccess problems.
* Access Logs: Also under "Metrics" > "Raw Access Logs". These show incoming requests and can help identify if traffic is reaching your server.
File Permissions
Incorrect file permissions can prevent WordPress from reading or writing files, leading to errors. Standard WordPress permissions are:
* Directories: 755 * Files: 644 * wp-config.php`: 640 or 600 (for enhanced security)
You can correct these using cPanel's File Manager or via SSH if you have root access.
Database Search and Replace
If your WordPress site has many internal links or image URLs hardcoded with the old domain, you'll need to perform a database search and replace. Tools like WP-CLI (for advanced users) or plugins like "Better Search Replace" can safely update these entries. This is crucial for SEO and ensuring all assets load correctly.
Post-Migration Checklist
After fixing initial issues, run through a comprehensive checklist:
* Test all forms: Contact forms, inquiry forms, e-commerce checkout (Khalti, eSewa). * Check all pages and posts: Ensure content, images, and videos load correctly. * Verify plugin functionality: Test all installed plugins. * Monitor site speed: Use tools like Google PageSpeed Insights. * Check SSL certificate: Ensure HTTPS is working correctly on your new server. * Review backups: Confirm your new host is performing regular backups.
For Nepali startups, a smooth cPanel migration is vital for maintaining online presence and business operations. By systematically addressing common issues like DNS propagation, database connection errors, and permalink problems, you can minimize downtime and ensure your WordPress site runs perfectly on its new home. Hosting Nepal offers expert support and tailored hosting solutions designed to make your migration process as seamless as possible, providing peace of mind for your growing venture in the Nepali digital landscape.
