Manual Migration of WordPress from cPanel to Ubuntu 24.04 VPS Without Plugins

Introduction

Moving your WordPress site from a cPanel hosting environment to a dedicated Ubuntu 24.04 VPS can significantly improve your website's performance, security, and control. At ByteHosting, we understand that not everyone wants to rely on plugins or automated tools for migration. That’s why we’ve put together this comprehensive, step-by-step guide to manually migrate your WordPress site without using plugins. This approach ensures a clean, reliable transfer, giving you full control over each step.

Prerequisites

Before we begin, ensure you have the following:

  • A recent backup of your WordPress site, including files and database.
  • Access to your current cPanel hosting account.
  • Access to your new Ubuntu 24.04 VPS, with root or sudo privileges.
  • Basic knowledge of command-line operations.

If you’re considering a new VPS, our cost-effective plans in Frankfurt are a great choice to host your WordPress site securely and reliably.

Step 1: Export WordPress Database and Download Files from cPanel

Export the Database

Log into your cPanel account and navigate to phpMyAdmin. Select your WordPress database from the list on the left. Then, click on the Export tab.

Choose the Quick export method and the SQL format, then click Go. This will download a .sql file containing your database.

Download WordPress Files

Next, go back to cPanel’s File Manager. Locate your WordPress installation directory, typically in public_html. Select all files and folders, then click Compress to create a ZIP archive.

Download the ZIP file to your local machine. This archive contains all your themes, plugins, media, and core WordPress files.

Step 2: Set Up LAMP Stack on Ubuntu VPS

If your Ubuntu VPS isn’t already set up with a LAMP stack (Linux, Apache, MySQL, PHP), you’ll need to install it. Here’s a quick command sequence:

sudo apt update
sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql -y

Secure your MySQL installation and configure PHP as needed. This setup provides the environment necessary to run WordPress.

Step 3: Import Database and Configure wp-config.php

Create a New Database

Log into MySQL:

sudo mysql -u root -p

Create a new database for WordPress:

CREATE DATABASE wordpress_db DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Create a new MySQL user and grant privileges:

CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Import the Database

Upload your exported SQL file to the VPS, for example, using SCP or SFTP. Then, import it into your new database:

mysql -u wpuser -p wordpress_db < /path/to/your/backup.sql

Configure wp-config.php

On your VPS, create a directory for your WordPress site, e.g., /var/www/yourdomain.com. Extract your ZIP archive here. Then, edit wp-config.php to match your new database credentials:

define('DB_NAME', 'wordpress_db');
define('DB_USER', 'wpuser');
define('DB_PASSWORD', 'your_password');
define('DB_HOST', 'localhost');

Step 4: Upload WordPress Files and Set Permissions

Upload your WordPress files to the web directory, if not already done. Set proper permissions:

sudo chown -R www-data:www-data /var/www/yourdomain.com
sudo find /var/www/yourdomain.com -type d -exec chmod 755 {} \
sudo find /var/www/yourdomain.com -type f -exec chmod 644 {} \

This ensures your server can serve the files correctly and maintains security best practices.

Step 5: Test the Migrated Site and Troubleshoot

Point your domain’s DNS to your new VPS IP address. Once DNS propagation is complete, visit your site to verify everything works as expected.

If you encounter issues, check the following:

  • Database connection errors — verify your wp-config.php credentials.
  • File permission problems — ensure correct ownership and permissions.
  • Broken links or missing media — confirm files are correctly uploaded.

Use server logs located in /var/log/apache2/ to troubleshoot further.

Conclusion

Manually migrating your WordPress site from cPanel to an Ubuntu 24.04 VPS might seem daunting at first, but with careful steps, it’s straightforward and gives you full control over the process. At ByteHosting, we’re committed to providing reliable, affordable VPS hosting solutions in Frankfurt that support your website’s growth. Whether you’re moving a single site or managing multiple projects, our infrastructure is ready to host your WordPress sites securely and efficiently.

If you need a flexible VPS plan to host your WordPress site, explore our offerings and get started today. Remember, a manual migration ensures a clean transfer and a better understanding of your hosting environment. Happy migrating!

Read more