Migrating a WordPress website can seem like a daunting task, akin to moving your entire digital home from one address to another. While there are excellent plugins that automate much of this process, understanding the manual method offers invaluable insight into your site’s structure, provides a reliable fallback, and is often necessary for more complex or restrictive hosting environments.
This detailed tutorial will walk you through the precise steps required to manually move your WordPress site – whether you’re switching hosting providers, changing domain names, or simply moving your site to a new subdirectory. We’ll break down each action into clear, manageable instructions, empowering you with the knowledge to execute a flawless migration.
Why Migrate Manually?
You might choose a manual migration for several reasons:
- Learning and Control: Gain a deeper understanding of your WordPress installation and database.
- Troubleshooting: Essential for diagnosing issues during plugin-based migrations.
- No Plugin Restrictions: Some hosts restrict plugin installations or resource usage that migration plugins might require.
- Specific Scenarios: Ideal for moving a development site to a live environment, or vice-versa, with precise control.
- Cost-Effective: Avoids the cost of premium migration plugins.
Before we begin, remember the golden rule of any significant website change: Always back up everything! This migration involves direct interaction with your database and core files, so thorough backups are non-negotiable.
Prerequisites and Tools You’ll Need
To successfully complete this manual migration, ensure you have access to the following:
- FTP Client: Software like FileZilla (free) to connect to your old and new hosting servers and transfer files.
- Database Management Tool: Typically phpMyAdmin, accessible through your hosting control panel (e.g., cPanel, Plesk).
- Text Editor: A plain text editor (like Notepad++, Sublime Text, VS Code, or even a basic Notepad) for editing configuration files. Avoid rich text editors like Microsoft Word, as they can introduce formatting that breaks code.
- Old Hosting Credentials: FTP username/password and phpMyAdmin access for your current host.
- New Hosting Credentials: FTP username/password and database access details (database name, username, password, host) for your new host.
- Patience and Attention to Detail: These are your most powerful tools!
The Step-by-Step Manual Migration Process
Step 1: Back Up Your Existing WordPress Website (Crucial!)
Before touching anything, create complete backups of both your WordPress files and your database from your old host. This is your safety net.
- Backup Your WordPress Files:
- Connect to your old host via your FTP client.
- Navigate to your WordPress installation directory (often ZEALTERCODE0, ZEALTERCODE1, or a subdomain folder).
- Select all files and folders within your WordPress root directory.
- Download them to a designated folder on your local computer. This can take some time depending on your site’s size.
- Tip: While downloading, ensure hidden files (starting with a dot, like ZEALTERCODE0) are also included in your download settings.
- Backup Your WordPress Database:
- Log in to your old host’s control panel (e.g., cPanel).
- Find and open phpMyAdmin (usually under “Databases”).
- In phpMyAdmin, select your WordPress database from the left sidebar. If you’re unsure which one, check your ZEALTERCODE0 file (from the files you just downloaded) for ZEALTERCODE1.
- Click on the “Export” tab at the top.
- Select “Custom” as the Export Method (this gives you more options).
- Ensure all tables are selected.
- Under “Output,” choose “gzipped” or “zipped” for compression (if available) to reduce file size, or simply leave it as “None” for a ZEALTERCODE0 file.
- Ensure the format is SQL.
- Scroll to the bottom and click “Go”. Save the ZEALTERCODE0 (or compressed ZEALTERCODE1/ZEALTERCODE2) file to your local computer, ideally in the same folder as your file backup.
Step 2: Create a New Database on Your New Host
You need a fresh database on your new hosting account to import your old site’s data into.
- Log in to your new host’s control panel (e.g., cPanel).
- Navigate to the “MySQL Databases” section (usually under “Databases”).
- Create a New Database:
- Enter a new, unique name for your database (e.g., ZEALTERCODE0).
- Click “Create Database”.
- Crucial: Make a note of the full database name (it often has a prefix like ZEALTERCODE0).
- Create a New Database User:
- Scroll down to “MySQL Users.”
- Enter a username (e.g., ZEALTERCODE0).
- Generate a strong password (use the password generator) and make a secure note of it.
- Click “Create User”.
- Crucial: Make a note of the full username (e.g., ZEALTERCODE0).
- Add User to Database:
- Scroll down to “Add User To Database.”
- Select the database user you just created from the “User” dropdown.
- Select the database you just created from the “Database” dropdown.
- Click “Add”.
- On the next screen, tick the “ALL PRIVILEGES” checkbox.
- Click “Make Changes”.
- Summary: You now have a database name, a database username, and a database password. Keep these handy!
Step 3: Import Your Database to the New Host
Now, let’s bring your old site’s data into the new database.
- Log in to your new host’s control panel.
- Open phpMyAdmin.
- From the left sidebar, select the new database you created in Step 2 (e.g., ZEALTERCODE0).
- Click on the “Import” tab at the top.
- Click “Choose file” and select the ZEALTERCODE0 (or ZEALTERCODE1/ZEALTERCODE2) database backup file you downloaded in Step 1.
- Ensure the format is “SQL”.
- Click “Go” at the bottom.
- Wait: Depending on the size of your database, this could take a few moments. You should see a success message upon completion.
- Troubleshooting Tip: If you encounter a file size limit error, you might need to import using SSH, increase phpMyAdmin’s upload limit via a ZEALTERCODE0 file (if your host allows), or use a script like Adminer for larger databases. For this tutorial, we assume a typical-sized site that phpMyAdmin can handle.
Step 4: Edit the ZEALTERCODE0 File
The ZEALTERCODE0 file is your WordPress site’s brain, containing crucial database connection details. You need to update it with your new host’s information.
- Locate the ZEALTERCODE0 file in the WordPress files you downloaded in Step 1.
- Open it with your plain text editor.
- Find the following lines and update them with the new database details you noted in Step 2:
define( 'DB_NAME', 'your_new_database_name' );
define( 'DB_USER', 'your_new_database_username' );
define( 'DB_PASSWORD', 'your_new_database_password' );
define( 'DB_HOST', 'localhost' ); // This is usually 'localhost', but your host might specify a different value. Check their documentation if 'localhost' doesn't work.
- If you are changing your domain name or moving your site to a new subdirectory, you must also update your site’s URL. Find a good place after the database details (e.g., just above ZEALTERCODE0) and add these two lines, replacing ZEALTERCODE1 with your site’s actual new URL:
define('WP_HOME','https://www.yournewdomain.com');
define('WP_SITEURL','https://www.yournewdomain.com');
- Explanation: These lines temporarily hardcode your site’s URL, preventing redirection loops or broken links before the database is fully updated. They override the database values, ensuring your site loads correctly on the new domain.
- Save the ZEALTERCODE0 file.
Step 5: Upload WordPress Files to the New Host
Now it’s time to transfer all your WordPress files to the new hosting environment.
- Connect to your new host via your FTP client.
- Navigate to the directory where you want your WordPress site to reside. This is usually ZEALTERCODE0, ZEALTERCODE1, or a specific subdirectory if you’re installing it there. Ensure the directory is empty or contains only default files (which you can safely delete if they’re not required for your new host).
- Upload all the WordPress files and folders (including the modified ZEALTERCODE0) from your local computer to this directory on your new host.
- Tip: If you had a caching plugin on your old site, it’s often a good idea to delete its cache folders (e.g., ZEALTERCODE0) from your local backup before uploading to prevent potential issues. These will be regenerated by the plugin.
Step 6: Update URLs in the Database (Crucial for Link Integrity)
Even if you added ZEALTERCODE0 and ZEALTERCODE1 to ZEALTERCODE2, many references to your old domain (in posts, images, custom fields, etc.) remain in your database. These need to be updated. A simple search-and-replace won’t work perfectly for serialized data (like widget settings or plugin options), so a special tool or SQL query is required.
Option A: Using an SQL Query (for simple changes)
This method is suitable for basic domain changes but might miss serialized data.
- Log in to your new host’s control panel and open phpMyAdmin.
- Select your new WordPress database from the left sidebar.
- Click the “SQL” tab at the top.
- Execute the following SQL queries, replacing ZEALTERCODE0 with your old domain and ZEALTERCODE1 with your new domain.
- Run these queries one by one, clicking “Go” after each.
UPDATE wp_options SET option_value = REPLACE(option_value, 'https://www.olddomain.com', 'https://www.newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = REPLACE(post_content, 'https://www.olddomain.com', 'https://www.newdomain.com');
UPDATE wp_posts SET guid = REPLACE(guid, 'https://www.olddomain.com', 'https://www.newdomain.com');
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'https://www.olddomain.com', 'https://www.newdomain.com');
-- Note: 'wp_' is the default table prefix. If your site uses a different prefix (e.g., 'abc_'), adjust it in all queries.
- Tip: These queries handle common occurrences, but for a truly robust solution, Option B is generally preferred.
Option B: Using a Search and Replace Script (Recommended for comprehensive updates)
This method correctly handles serialized data within your database.
- Download a reliable search-and-replace script, such as the “Search and Replace DB” script by interconnect/it. You can usually find it by searching for “interconnect/it Search and Replace DB script.”
- Extract the downloaded ZIP file.
- Using your FTP client, upload the entire extracted folder (e.g., ZEALTERCODE0) to your new host, placing it in your WordPress root directory (the same level as ZEALTERCODE1).
- Open your web browser and navigate to the script’s URL. For example, if your new domain is ZEALTERCODE0, the URL would be ZEALTERCODE1 (or whatever the folder name is).
- The script will automatically populate your database credentials from ZEALTERCODE0. Verify they are correct.
- In the “replace” fields:
- “replace” (first field): Enter your old domain URL, exactly as it was (ZEALTERCODE0).
- “with” (second field): Enter your new domain URL, exactly as it should be (ZEALTERCODE0).
- Crucial: Ensure you include the ZEALTERCODE0 or ZEALTERCODE1 prefix and any ZEALTERCODE2 or trailing slashes as appropriate for both old and new URLs. If your old site was ZEALTERCODE3 and your new site will be ZEALTERCODE4, replace ZEALTERCODE5 with ZEALTERCODE6. You might need to run the script twice: once for ZEALTERCODE7 to ZEALTERCODE8 and again for ZEALTERCODE9 to ZEALTERCODE10 to catch all permutations.
- Click “Do a dry run” first. This will show you what changes the script would make without actually applying them. Review the results to ensure they look correct.
- If the dry run looks good, click “Live run” to apply the changes to your database.
- Extremely Important: Once the script has finished, delete the ZEALTERCODE0 folder (or whatever you named it) and its contents completely from your server using FTP. Leaving it on your server is a major security risk.
Step 7: Update Your Domain’s DNS Records (If Changing Domain/Host)
If you’ve moved to a new hosting provider, you need to tell your domain name (e.g., ZEALTERCODE0) where to find your website on the new server.
- Log in to your domain registrar’s control panel (e.g., GoDaddy, Namecheap, Cloudflare).
- Find the DNS management section for your domain.
- Update the nameservers to those provided by your new hosting company (e.g., ZEALTERCODE0, ZEALTERCODE1). This is the most common method.
- Alternatively, if you’re keeping your nameservers with your registrar or using a service like Cloudflare, you’ll need to update the A record to point to your new host’s IP address.
- DNS Propagation: Be aware that it can take anywhere from a few minutes to 48 hours (rarely longer) for these changes to fully propagate across the internet. During this time, some visitors might see your old site, while others see your new one. Clear your browser cache and try accessing your new domain periodically.
Step 8: Final Checks and Post-Migration Tasks
Your site should now be accessible on the new domain/host, but some final touches are needed.
- Clear Browser Cache: Clear your web browser’s cache completely to ensure you’re seeing the latest version of your site from the new server.
- Test Everything:
- Navigate through all your pages and posts.
- Test all internal and external links.
- Check images and embedded media to ensure they display correctly.
- Submit forms (contact forms, comment forms) to ensure they work.
- Test user logins (if applicable).
- Check your site’s appearance across different browsers and devices.
- Update Permalinks:
- Log in to your WordPress admin dashboard on the new site (ZEALTERCODE0).
- Go to Settings > Permalinks.
- Without making any changes, simply click “Save Changes”. This regenerates your ZEALTERCODE0 file on the new server, ensuring all your links resolve correctly.
- Deactivate and Reactivate Plugins:
- Go to Plugins > Installed Plugins.
- Select all plugins.
- Choose “Deactivate” from the bulk actions dropdown and click “Apply.”
- Once deactivated, select all plugins again and choose “Activate” from the bulk actions dropdown and click “Apply.” This can help plugins re-register their paths and settings with the new environment.
- Clear Caching Plugin Cache: If you use a caching plugin (like WP Super Cache, LiteSpeed Cache, WP Rocket), clear its cache completely from within its settings.
- Verify SSL Certificate (if applicable): If your new site uses HTTPS, ensure your host has installed an SSL certificate correctly for your domain. Test by trying to access ZEALTERCODE0 version of your site.
- Remove ZEALTERCODE0 and ZEALTERCODE1 from ZEALTERCODE2 (Optional but Recommended): Once you’ve confirmed everything is working and permalinks are saved, you can remove the ZEALTERCODE3 and ZEALTERCODE4 lines from ZEALTERCODE5. WordPress will then use the values stored in the database. Only do this if you are confident your database updates were thorough.
Conclusion
Congratulations! You have successfully performed a manual WordPress migration. While it requires precision and patience, mastering this process gives you complete control and understanding of your WordPress installation. This skill is invaluable for any serious WordPress user or developer, providing a robust solution for nearly any migration challenge. Remember to keep your backups safe and enjoy your new, successfully migrated website!