Migrating a WordPress website from Amazon Lightsail to Bluehost involves several steps. Here’s a step-by-step guide to ensure a smooth migration:
Step 1: Prepare Your Bluehost Account
- Login to Bluehost: Access your Bluehost account dashboard.
- Set up Hosting: Ensure your hosting environment is ready with a new domain or subdomain for the WordPress website.
- Install WordPress: Use Bluehost’s one-click WordPress installer to create a fresh installation.
Step 2: Backup Your Lightsail WordPress Site
- Log in to Lightsail: Access your Lightsail console and identify the instance hosting your WordPress site.
- Access Your Instance via SSH: Open the terminal and connect to your Lightsail instance via SSH.
bash
Copy code
ssh -i Lightsail-Key.pem ubuntu@<Public-IP>
- Export Your Database:
- Locate your database credentials in the wp-config.php file.
- Run the following command to export your database:
bash
Copy code
mysqldump -u <DB_USER> -p <DB_NAME> > wordpress_db.sql
- Compress WordPress Files:
- Navigate to the WordPress directory, usually /var/www/html.
- Compress your WordPress files:
bash
Copy code
sudo tar -czvf wordpress_files.tar.gz /var/www/html
- Download the Backup Files:
- Use SCP to transfer the files to your local machine:
bash
Copy code
scp -i Lightsail-Key.pem ubuntu@<Public-IP>:~/wordpress_files.tar.gz .
scp -i Lightsail-Key.pem ubuntu@<Public-IP>:~/wordpress_db.sql .
Step 3: Upload Files to Bluehost
- Log in to cPanel on Bluehost.
- Upload the Files:
- Use the File Manager or an FTP client (e.g., FileZilla) to upload wordpress_files.tar.gz to the Bluehost directory (e.g., /public_html).
- Extract the Files:
- Navigate to the File Manager, locate the uploaded file, and extract it.
- Import the Database:
- In cPanel, go to phpMyAdmin.
- Create a new database.
- Import the wordpress_db.sql file into this database.
Step 4: Update Configuration
- Modify wp-config.php:
- Update database credentials in the wp-config.php file:
php
Copy code
define(‘DB_NAME’, ‘new_database_name’);
define(‘DB_USER’, ‘new_database_user’);
define(‘DB_PASSWORD’, ‘new_password’);
define(‘DB_HOST’, ‘localhost’);
- Update Site URL:
- Access phpMyAdmin and update the siteurl and home values in the wp_options table to match your new Bluehost domain.
Step 5: Test Your Website
- Preview Your Site:
- Temporarily use Bluehost’s preview URL or modify your local hosts file to map the domain to Bluehost’s IP.
- Fix Any Issues:
- Verify functionality, including plugins, themes, and permalinks.
- Re-save permalinks under WordPress Settings > Permalinks.
Step 6: Update DNS
- Update Domain Nameservers:
- Log in to your domain registrar (e.g., Groenhost.com).
- Replace the current nameservers with Bluehost’s nameservers:
- ns1.bluehost.com
- ns2.bluehost.com
- Wait for Propagation:
- DNS changes can take up to 48 hours to propagate globally.
Step 7: Secure Your Site
- Enable SSL:
- Use Bluehost’s SSL tool to enable a free SSL certificate.
- Update the WordPress URL to use HTTPS.
Step 8: Final Testing
- Verify the site works as expected.
- Check for broken links or missing resources.
- Monitor performance and traffic to ensure smooth operation.
Let me know if you need help with specific steps!