Background:
Based on the considerations of requirements, controls, budgets and performance you may wish to migrate your WordPress website/blog from your current hosted service provider to amazon EC2 instance. I have migrated one of my website to the amazon EC2 and like to share my experience so it may help others. The migrated website was hosted in NameCheap and during further development faced some limitations, as my hosting package doesn’t offer full control of the underlying environment so i decided to move my site on EC2 Bitnami WordPress stack.
Workaround:
- Launch an EC2 instance of WordPress Certified by Bitnami. here
- Assign an Elastic IP address to the EC2 instance. here
- Check to see you can visit your site migrated to the Bitnami instance when supplied the assigned Elastic IP.
- Connect to phpmyadmin of the deployed EC2 WordPress instance. here
- List all the plugins you are using on your existing functional site.
- Login to the wordpress Admin panel of your migrating site.
- Go to Plugins > Installed Plugins
- Take backup of your migrating WordPress site database.
- Connect to the phpmyadmin.
- Select the database of your site.
- Go to Export
- Select Export method as Custom and Format as SQL.
- Go to section Object creation options.
- Select the Add
CREATE DATABASE / USE
statement - Select the Add
DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT
/ TRIGGER
statement - Click Go
- Backup will start downloading to your pc.
- Install all your necessary plugins you listed above in the new Bitnami WordPress installation.
- Login to the wordpress Admin panel of your migrating site.
- Go to Plugins > Add New
- Activate your installed plugins.
- Install and Activate your migrating site WordPress theme.
- Restore the backed-up database of your migrating site in the new Bitnami WordPress installation.
- Connect to the phpmyadmin of the Bitnami instance.
- Go to Import.
- Don’t select any database on the left.
- Choose file (backed up database file) under File to import.
- Click Go bottom of the page to import the database.
- Database contents will be imported.
- Go to the wp-config file and edit the DB_NAME and table_prefix matched with your restored database backup to work.
- Give proper access to the database user to the imported database.
- Disable WordPress cron script. here
- Configure outbound email settings. here
- Install memcached module for caching. here Download latest
- Update your domain DNS record to the Bitnami instance Elastic IP address. here
- Wait for minutes and check your domain redirection with whatmydns.
- Visit the site with domain name.
- Generate and install Let’s Encrypt SSL certificate for your site. here
- Be sure to mention the domain name as you like to see, such as with or without www
- Configure the website to use the SSL as default.
- Edit the /opt/bitnami/apache2/conf/bitnami/bitnami.conf file,add the below codes just under the
-
RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
- Restart the apache server.
- Browse to your site to see SSL works perfectly.
- Remove or rename the bnconfig file.
- Remove the Bitnami badge. here
- Create a full backup of your WordPress installation.
🙂