Introduction:
Imagine your WordPress website getting hacked. Cyberattacks can steal data, damage your reputation, and put your site at risk. To avoid data loss, it's important to keep your files, content, media, and plugins safe. Manually migrating your website is a reliable way to move everything while keeping your themes and data intact. This method helps you transfer your site to a new directory or server without relying on automated tools.
Manual migration also gives you full control over files and databases, ensuring everything is set up as needed. However, moving a WordPress site to a live Ubuntu server can be challenging for beginners. In this guide, we’ll walk you through the step-by-step process of migrating your WordPress website using command lines.
Here are the Ubuntu commands to copy the necessary files from your old WordPress directory (outrightsystems.org-20feb) to the new one (outrightsystems.org). Let’s get started!
Step 1: Navigate to Your Web Root Directory
First, open your terminal and go to the root directory where the WordPress installation is located. Most WordPress installations are located in /var/www/html/, but examine and adjust accordingly if your setup is different.
cd /var/www/html/
Step 2: Copy the Active Theme
The theme controls the website design and layout—transferring it properly is crucial to maintaining the same look of your website. Run the following command to copy your entire themes folder:
cp -r outrightsystems.org-20feb/wp-content/themes/your-theme-folder
outrightsystems.org/wp-content/themes/
Once the file is copied, make sure they have the correct permissions to ensure smooth workflow:
chown -R www-data:www-data outrightsystems.org/wp-content/themes/your-theme-folder
chmod -R 755 outrightsystems.org/wp-content/themes/your-theme-folder
Step 3: Copy Uploaded Media Files (Icons & Images)
To migrate all uploads, use the following command to prevent broken images on your website:
cp -r outrightsystems.org-20feb/wp-content/uploads/* outrightsystems.org/wp-content/uploads/
Now, set the correct permissions:
chown -R www-data:www-data outrightsystems.org/wp-content/uploadschmod -R 755 outrightsystems.org/wp-content/uploads
Step 4: Copy Plugins (If Needed)
Plugins add new features and functionality to your WordPress website, eliminating the need for code modification. Move plugins using the following command.
cp -r outrightsystems.org-20feb/wp-content/plugins/* outrightsystems.org/wp-content/plugins/
Then, fix permissions:
chown -R www-data:www-data outrightsystems.org/wp-content/pluginschmod -R 755 outrightsystems.org/wp-content/plugins
Step 5: Copy wp-config.php (Manually)
Do not copy wp-config.php directly from the old installation. Instead, open both files in the editor and copy necessary configurations manually:
nano outrightsystems.org-20feb/wp-config.phpnano outrightsystems.org/wp-config.php
Copy only essential settings like database configurations, security salts, or cache settings that need to be mitigated.
Step 6: Copy .htaccess (Manually)
Similar to wp-config.php, do not copy .htaccess directly—this file contains rukes for redirects, permalinks, and security. Instead, compare and copy specific settings manually:
nano outrightsystems.org-20feb/.htaccessnano outrightsystems.org/.htaccess
Step 7: Fix File Ownership & Permissions
After all files are copied, ensure they have the correct ownership and permissions to avoid any issues:
chown -R www-data:www-data outrightsystems.orgchmod -R 755 outrightsystems.org
Step 8: Restart Web Server
Restart your web server depending on which server you are using, such as Apache or Nginx.
For Apache:
systemctl restart apache2
For Nginx:
systemctl restart nginx
Step 9: Verify Everything
Now all the things are done—monitor and recheck everything is working correctly, and ensure your new WordPress is installed correctly.
💠Log in to your new WordPress admin panel.
💠Go to Appearance > Themes and check if your theme appears.
💠Go to Media Library and confirm images are visible.
💠Go to Plugins and activate the necessary plugins.
Finishing Up
Unlike traditional tools, mitigating your WordPress website manually might take more effort—but this allows you to control and monitor the overall process. This guide has everything you need to know about migrating a WordPress site to a live Ubuntu server. Following these steps will ensure that your website's theme, media files, and plugins are transferred correctly—ensuring a smooth working process and reducing errors.