How to Manually Migrate WordPress from One Server to Another for Beginners

Ramiz ThebaRamiz Theba
4 min read

Manually Migrate WordPress from One Server to Another

Migrating a WordPress website from one server to another can seem like a daunting task, especially for beginners. However, with careful planning and execution, it can be a smooth and successful process. In this article, we will provide you with a step-by-step guide on how to manually migrate a WordPress website from one server to another, along with the necessary code snippets and MySQL queries.

Pre-Migration Checklist:

Before starting the migration process, it's important to perform a few preliminary tasks:

  1. Take a backup: Create a backup of your WordPress website, including both the files and the database. This will serve as a safety net in case anything goes wrong during the migration process.

  2. Update WordPress and plugins: Make sure your WordPress installation and all plugins are up-to-date to avoid any compatibility issues during the migration process.

  3. Note down server details: Take note of the server details of both the source and destination servers, including the FTP login credentials, database name, username, password, and host details. You will need these details during the migration process.

Migration Steps:

Step 1: Export the Database

  1. Access the phpMyAdmin tool on the source server.

  2. Select the database associated with your WordPress website.

  3. Click on the "Export" tab, and select the "Quick" export method.

  4. Click on the "Go" button to download the SQL file containing the database.

Step 2: Download WordPress Files

  1. Connect to the source server using FTP or a file manager tool.

  2. Navigate to the root directory of your WordPress installation.

  3. Download all the files and folders to your local computer.

Step 3: Upload WordPress Files to Destination Server

  1. Connect to the destination server using FTP or a file manager tool.

  2. Navigate to the root directory of your WordPress installation.

  3. Upload all the files and folders from your local computer to the destination server.

Step 4: Create a New Database on Destination Server

  1. Access the phpMyAdmin tool on the destination server.

  2. Click on the "New" button to create a new database.

  3. Enter a unique name for the new database, and click on the "Create" button.

Step 5: Import the Database

  1. Access the phpMyAdmin tool on the destination server.

  2. Select the database you created in Step 4.

  3. Click on the "Import" tab.

  4. Click on the "Choose File" button, and select the SQL file that you downloaded in Step 1.

  5. Click on the "Go" button to import the database.

Step 6: Update WordPress Configuration

  1. Access the destination server using FTP or a file manager tool.

  2. Locate the "wp-config.php" file in the root directory of your WordPress installation.

  3. Open the "wp-config.php" file in a text editor.

  4. Update the following database details with the ones of the destination server:

  5. Save and close the "wp-config.php" file.

define('DB_NAME', 'your_database_name');
define('DB_USER', 'your_database_username');
define('DB_PASSWORD', 'your_database_password');
define('DB_HOST', 'your_database_host');

Step 7: Update URLs in the Database

  1. Access the phpMyAdmin tool on the destination server.

  2. Select the database you imported in Step 5.

  3. Click on the "SQL" tab.

  4. Run the following MySQL queries, one at a time, to update the URLs in the database:

UPDATE wp_options SET option_value = replace(option_value, 'old_url', 'new_url') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET post_content = replace(post_content, 'old_url', 'new_url');

UPDATE wp_postmeta SET meta_value = replace(meta_value, 'old_url', 'new_url');

Note: Replace 'old_url' with the URL of your source server and 'new_url' with the URL of your destination server.

Step 8: Verify Site Functionality

  1. Access your WordPress website on the destination server using the new URL.

  2. Verify that all the pages, posts, images, and plugins are functioning correctly.

  3. Test all the forms, links, and functionalities on your website to ensure everything is working as expected.

Post-Migration Checklist:

After completing the migration process, it's important to perform a few post-migration tasks:

  1. Update DNS: If you have changed the domain name or server, update the DNS settings of your domain to point to the new server.

  2. Test Site Speed and Performance: Check the site speed and performance on the new server to ensure optimal performance.

  3. Update Backup and Security Plugins: If you are using any backup or security plugins, update their settings to reflect the changes in the new server.

  4. Check for Broken Links: Scan your website for any broken links or missing images, and fix them if necessary.

  5. Test Contact Forms and Email Notifications: Test all the contact forms on your website to ensure they are sending emails correctly.

Conclusion:

Migrating a WordPress website from one server to another may seem overwhelming at first, but by following the above step-by-step guide and performing the necessary pre-migration and post-migration tasks, you can successfully transfer your website to a new server. Always remember to take backups and double-check all the details to avoid any potential issues. With careful planning and execution, your WordPress website will be up and running smoothly on the new server in no time.

1
Subscribe to my newsletter

Read articles from Ramiz Theba directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ramiz Theba
Ramiz Theba

As a web developer, I have a passion for creating visually stunning and user-friendly websites. With several years of experience in both front-end and back-end development, I am well-versed in a variety of programming languages and frameworks. I am a problem solver at heart, and I enjoy the challenge of finding solutions to complex issues. I am always learning and staying current with the latest web technologies to ensure that my clients' websites are cutting-edge. My ultimate goal is to create websites that not only look great, but also provide a seamless and enjoyable user experience.