Migrating a WordPress website to a new hosting environment, such as Plesk, can seem like a daunting task. However, by following a structured manual process, you can ensure a smooth and successful transition for your website. This guide provides a step-by-step approach to manually transfer your WordPress installation, including all its files and database, to a Plesk-powered server.
Understanding the Migration Process
A manual WordPress migration involves several key stages: backing up your existing website, setting up the new environment on Plesk, transferring your website's files and database, and finally, configuring your site to work with the new server. While automated tools exist, understanding the manual process provides greater control and insight into your website's infrastructure.
Prerequisites for a Successful Migration
Before you begin the migration process, ensure you have the following:
- Access to your current WordPress hosting account (FTP/SFTP, database access).
- Access to your Plesk control panel.
- FTP client (e.g., FileZilla) for file transfers.
- A text editor for modifying configuration files.
- Sufficient disk space on your local computer to store backups.
Step-by-Step Manual Migration Guide
1. Back Up Your Existing WordPress Website
The first and most crucial step is to create a complete backup of your current WordPress site. This includes both your website's files and its database.
Backup WordPress Files:
Connect to your current hosting account using an FTP client or file manager. Navigate to your WordPress installation directory (often public_html, www, or your domain's folder) and download all files and folders to a local directory on your computer.
Backup WordPress Database:
Access your current hosting's control panel (e.g., cPanel, phpMyAdmin) and locate your WordPress database. Export the database as an SQL file. This file contains all your posts, pages, comments, user information, and settings.
2. Create a New Database and Database User in Plesk
On your Plesk control panel, you need to set up a new database for your WordPress installation.
- Log in to your Plesk panel.
- Navigate to Databases under your domain.
- Click Add Database.
- Enter a descriptive database name (e.g.,
wp_newsite). - Create a new database user with a strong password. Note down the database name, username, and password, as you will need them later.
- Assign the user to the newly created database.
3. Upload WordPress Files to Plesk
Now, transfer the WordPress files you backed up earlier to your Plesk hosting account.
- Connect to your Plesk server using an FTP client with your domain's FTP credentials.
- Navigate to the
httpdocsdirectory for your domain (this is typically where your website files reside). - Upload all the WordPress files and folders you downloaded from your old host into the
httpdocsdirectory. This process might take some time, depending on the size of your website.
4. Import Your WordPress Database to Plesk
After uploading the files, import your database backup into the newly created Plesk database.
- In your Plesk panel, go to Databases.
- Click on the database you created in Step 2.
- Click on Webadmin to open phpMyAdmin.
- In phpMyAdmin, select your database from the left sidebar.
- Click the Import tab.
- Click Choose File and select the SQL backup file you created in Step 1.
- Ensure the character set is correct (usually UTF-8).
- Click Go to start the import.
5. Update the wp-config.php File
The wp-config.php file needs to be updated with the new database details for your WordPress site to connect to the database on Plesk.
- Locate the
wp-config.phpfile in your WordPress installation directory on the Plesk server (using FTP or Plesk File Manager). - Download the file and open it with a text editor.
- Find the following lines and update them with the database name, username, and password you created in Step 2:
define('DB_NAME', 'your_database_name'); define('DB_USER', 'your_database_username'); define('DB_PASSWORD', 'your_database_password'); define('DB_HOST', 'localhost'); // This is usually 'localhost' but might vary. Check Plesk database info if unsure. - If your domain name has changed or you're moving from a subdirectory, you might also need to update the
WP_HOMEandWP_SITEURLconstants, or use a search-and-replace plugin after the site is live. For a direct domain migration, this is often not necessary at this stage. - Save the modified
wp-config.phpfile and upload it back to your Plesk server, overwriting the old one.
6. Update Permalinks (and Search/Replace if Necessary)
Once your site is connected to the database, it's good practice to refresh your permalinks and, if your domain or URL structure has changed, perform a search and replace operation.
- Access your WordPress admin dashboard (e.g.,
yourdomain.com/wp-admin). - Go to Settings > Permalinks.
- Without making any changes, simply click Save Changes. This action will refresh your permalink structure.
- If you changed your domain name or moved your site from a subdirectory, you might have old URLs embedded in your posts, pages, and media. Use a plugin like "Better Search Replace" or a similar database search-and-replace tool to update all instances of your old URL to the new one.
7. Test Your Website
Before updating your DNS, you can test your website by modifying your local hosts file to point your domain to the new Plesk server's IP address. This allows you to browse the site on the new server without affecting live traffic.
Once satisfied, remove the hosts file modification.
8. Update Your DNS Records
The final step is to point your domain to the new Plesk server.
- Log in to your domain registrar's control panel.
- Locate your domain's DNS settings.
- Update the 'A' record for your domain (and any 'www' CNAME records if applicable) to point to the IP address of your Plesk server.
- DNS changes can take 24-48 hours to propagate across the internet. During this period, some visitors might still see your old site, while others see the new one.
Conclusion
Manually migrating a WordPress website to Plesk requires careful attention to detail, but by following these steps, you can successfully transfer your site with confidence. Remember to always create backups before making significant changes and to thoroughly test your site after migration. A well-executed migration ensures your website remains accessible and performs optimally on its new Plesk environment.
