How to Manually Migrate a WordPress Site (2024 Guide)
Migrating a WordPress site manually can seem daunting, but with the right steps and attention to detail, it becomes a manageable process. Whether you’re switching to a new host or relocating your site to a different domain, this comprehensive guide will walk you through the essential steps. Follow these instructions carefully to ensure a smooth and error-free migration.
If you need professional assistance, consider working with a reliable WordPress Website Development Company in Bangalore, like Kleverway. Their team of experts can help with seamless migrations, custom WordPress solutions, and ongoing maintenance to keep your site secure and fully functional.
Step 1: Back Up Your Existing WordPress Site
Before starting the migration process, it is crucial to create a full backup of your site. This includes both the files and the database.
Backing Up Files
- Use an FTP Client like FileZilla to connect to your website’s server.
- Navigate to your WordPress root directory, usually named public_html or www.
- Download all the files to your local computer. Ensure the .htaccess file is included by enabling hidden files in your FTP client.
Exporting the Database
- Log in to your cPanel or web hosting dashboard.
- Open phpMyAdmin and select your WordPress database.
- Click on the Export tab and choose the Quick method with the SQL format.
- Download the exported .sql file and store it securely.
Step 2: Prepare the New Hosting Environment
To successfully migrate your WordPress site, your new hosting environment should be ready for the transfer.
Set Up the Database
- Log in to the new host’s control panel.
- Go to MySQL Databases and create a new database.
- Note down the database name, username, and password, as you’ll need them later.
Upload WordPress Files
- Use an FTP client to upload the files you downloaded from your old site to the new server’s root directory.
- Ensure the file structure mirrors the original site.
Step 3: Import the Database
Using phpMyAdmin
- Access phpMyAdmin on the new server.
- Select the newly created database.
- Go to the Import tab and upload the .sql file you exported earlier.
- Click Go to start the import process.
Step 4: Update the wp-config.php File
The wp-config.php file connects your WordPress installation to the database. After importing the database, update this file to reflect the new credentials.
- Locate the wp-config.php file in your WordPress root directory.
- Open it in a text editor and modify the following lines:
define(‘DB_NAME’, ‘new_database_name’);
define(‘DB_USER’, ‘new_database_user’);
define(‘DB_PASSWORD’, ‘new_database_password’)
- Save the changes and re-upload the file to the server.
Step 5: Update URLs in the Database
If you’re changing the domain name during migration, you’ll need to update all references to the old URL in the database.
Using SQL Queries
- Access phpMyAdmin and select your database.
Open the SQL tab and run the following commands:
UPDATE wp_options SET option_value = ‘http://newsite.com’ WHERE option_name = ‘siteurl’;
UPDATE wp_options SET option_value = ‘http://newsite.com’ WHERE option_name = ‘home’;
- Replace http://newsite.com with your new domain.
Search and Replace
For more extensive URL updates (e.g., media links), use a plugin like Better Search Replace after migration.
Step 6: Test Your Site on the New Server
Before making your site live, test it thoroughly to ensure everything works as expected.
- Edit the Hosts File on your computer to preview the site without changing the DNS:
- Add a line mapping your domain to the new server’s IP address.
- Example: 123.123.123.123 yourdomain.com.
- Add a line mapping your domain to the new server’s IP address.
- Open your browser and navigate to your site. Check for broken links, missing files, or database errors.
Step 7: Update DNS Settings
Once you’re satisfied with the migration, update the DNS settings to point your domain to the new server.
- Log in to your domain registrar.
- Locate the DNS settings for your domain.
- Update the A Record to the new server’s IP address.
- Allow 24-48 hours for DNS propagation.
Step 8: Final Checks
After the DNS changes take effect, perform these final checks to ensure everything runs smoothly:
- Test all pages, forms, and functionalities.
- Check for any missing media files or broken links.
- Confirm SSL is active (if applicable).
Troubleshooting Common Issues
Database Connection Error
- Double-check the database credentials in wp-config.php.
- Ensure the new database user has adequate privileges.
Permalinks Not Working
- Go to WordPress Settings > Permalinks and click Save to regenerate the .htaccess file.
White Screen of Death
Enable debugging in the wp-config.php file by setting:
define(‘WP_DEBUG’, true);
Migrating a WordPress site manually requires meticulous planning and execution. By following this step-by-step guide, you can ensure a seamless transition without any data loss or downtime. However, managing a migration can be complex, especially for larger websites with dynamic content. To make the process smoother and error-free, consider partnering with a trusted Website Maintenance Company in Bangalore, like Kleverway.
Their team of experts specializes in website migrations, ensuring your site remains secure, optimized, and fully functional during and after the transition. Save time and avoid potential issues by relying on professional support for all your website maintenance needs.