How to Perform a Complete WordPress Migration Manually

Migrating a WordPress website manually may sound intimidating, but it is a powerful skill for any website administrator or developer. Whether you are moving to a new hosting provider, upgrading your VPS, or simply reorganizing your infrastructure, understanding the manual migration process ensures you retain complete control. Unlike automated plugins, manual migration reduces dependency on third-party tools and gives you flexibility when handling large websites or custom configurations.

This article will walk you step by step through the full manual migration process: backing up your files, exporting the database, transferring everything to the new server, and reconfiguring WordPress to run smoothly.

Step 1: Back Up Your Files

Your WordPress site consists of two main parts: the files and the database. The files include WordPress core, themes, plugins, and uploaded media. To back them up:

  1. Log into your VPS using SSH or FTP.

  2. Navigate to the WordPress installation directory (commonly public_html or /var/www/html).

  3. Compress the entire folder into a .zip or .tar.gz archive for easier transfer:

    tar -czf wordpress-backup.tar.gz /var/www/html
  4. Download the archive to your local computer or transfer it directly to your new server.

Step 2: Export the Database

WordPress stores all content (posts, pages, comments, settings) in a MySQL or MariaDB database.

  1. Log into phpMyAdmin on your old host, or use the command line:

    mysqldump -u username -p database_name > database_backup.sql
  2. This creates a .sql file containing all your data.

  3. Download the SQL file to your local machine for safe keeping.

Step 3: Upload Files to the New Server

Once you have your backup archive, upload it to your new VPS:

  1. Use SCP, SFTP, or rsync to transfer files. For example:

    scp wordpress-backup.tar.gz user@new-server:/var/www/html
  2. On the new server, extract the archive into the desired directory:

    tar -xzf wordpress-backup.tar.gz -C /var/www/html
  3. Verify that the folder structure remains intact, especially /wp-content/ which contains your themes, plugins, and uploads.

Step 4: Import the Database

  1. Create a new database and user on your new VPS. For example:

    mysql -u root -p
    CREATE DATABASE newdb;
    CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'newpassword';
    GRANT ALL PRIVILEGES ON newdb.* TO 'newuser'@'localhost';
    FLUSH PRIVILEGES;
  2. Import your SQL file into this new database:

    mysql -u newuser -p newdb < database_backup.sql

Step 5: Update wp-config.php

Open the wp-config.php file in the root WordPress directory and update the database connection details:

define('DB_NAME', 'newdb');
define('DB_USER', 'newuser');
define('DB_PASSWORD', 'newpassword');
define('DB_HOST', 'localhost');

This ensures WordPress communicates with your new database.

Step 6: Update URLs (If Domain Changes)

If you are also moving to a new domain name, you need to update URLs inside the database. Run this SQL command:

UPDATE wp_options SET option_value = 'http://newdomain.com' WHERE option_name = 'siteurl';
UPDATE wp_options SET option_value = 'http://newdomain.com' WHERE option_name = 'home';

For more comprehensive changes (like links inside posts), use a search-and-replace tool on the SQL dump before importing.

Step 7: Test and Troubleshoot

  1. Point your domain’s DNS records to the new server’s IP.

  2. Clear browser and server caches.

  3. Test your site thoroughly: pages, posts, media, plugins, and admin login.

  4. Check file permissions (WordPress typically requires 755 for directories and 644 for files).

Benefits of Manual Migration

  • Full Control – You decide exactly what is transferred and how.

  • Reliability – No plugin dependencies that may break on large sites.

  • Learning Opportunity – You gain deeper knowledge of WordPress and server management.

Conclusion

Manually migrating a WordPress website may take more effort than using a plugin, but it is a reliable and flexible method. By carefully backing up your files, exporting and importing the database, reconfiguring wp-config.php, and testing the new setup, you can confidently move your site to a new VPS or hosting environment. With practice, manual migration becomes a routine task that empowers you to handle complex setups and ensure smooth transitions for your websites.