Migrating Bitnami WordPress website from AWS EC2 to VPS Bitnami NGINX

Steps to perform during migration:

  1. Install VPS with CentOS 7 without any LAMP stack.
  2. configure the x11 window and forwarding
  3. make a directory named as /bitnami to be used as installed directory
  4. Download the WordPress NGINX stack installer from bitnami.
  5. Login as root user, installation should be done as root user to avoid later complexities.
  6. upload the file to the server or download it from the server.
  7. install the perl module first https://docs.bitnami.com/installer/faq/linux-faq/administration/install-perl-linux/
  8. change the installer file permission to 755 to execute.
  9. execute the installer.
  10. Welcome window will appear click next.
  11. select installation folder.
  12. create admin account.
  13. supply the blog name.
  14. configure smtp settings skip it.
  15. deploy to the cloud skip it.
  16. ready to install.
  17. Installation completed.
  18. Go to the web browser and supply the ip address to see the website is up and running.
  19. Upload your current website theme folder to the new installation wp-content directory.
  20. Install the uploaded theme at the new installation.
  21. Take backup of your existing site by All-in-one-WP-Migration utility.
  22. Download the backup to your local PC.
  23. Upload the website backup to the new installation and import.
    • If needed increase the file upload size from /INSTALLDIR/APPNAME/php/etc/php.ini file
    • Edit the upload_max_filesize and optionally post_max_size to the appropriate value according to your export file size.
    • Edit the opt/bitnami/apps/APP_NAME/conf/nginx-app.conf file to change the client_max_body_size to greater size of the export file.
    • Import the website export file by All-in-one-WP-Migration plugin at new website.
  24. When import finish check to see everything is imported from your existing website to the new website.
  25. Create a new admin user for mysql database to connect from remote hosts and do admin tasks, don’t use root for security reason.
    • CREATE USER ‘myadmin’@’localhost’ IDENTIFIED BY ‘3-PKC77y^VtJUVJ*’;
      GRANT ALL PRIVILEGES ON *.* TO ‘myadmin’@’localhost’ WITH GRANT OPTION;
      CREATE USER ‘myadmin’@’%’ IDENTIFIED BY ‘3-PKC77y^VtJUVJ*’;
      GRANT ALL PRIVILEGES ON *.* TO ‘myadmin’@’%’ WITH GRANT OPTION;
  26. Change your website database if it was a custom one rather default ‘bitnami_wordpress’.
    • Export the database from the original site.
    • Create and import the database to the new site by MySQL workbench.
    • Grant appropriate permissions to the new imported database ‘xyz_wordpress‘ to the bn_wordpress user.
    • Edit the wp-config.php file to match the database and table prefix of the imported database.
    • Check to see the website is ok now.
  27. Export other custom application databases from the original site and import into the new one if needed.
  28. Enable Lets Encrypt SSL at the new website:
    • Configure SSL by lego. here
  29. Check the firewall is active and running:
    • service firewalld status
    • Enable firewall if not running:
      • service firewalld start
    • Configure the ethernet NIC
      • sudo firewall-cmd –zone=public –change-interface=eth0
    • Add services or port to firewall:
      • firewall-cmd –permanent –zone=public –add-service=https
      • firewall-cmd –permanent –zone=public –add-service=http
      • firewall-cmd –permanent –zone=public –add-port=3306/tcp
      • firewall-cmd –permanent –zone=public –add-port=80/tcp
      • firewall-cmd –permanent –zone=public –add-port=443/tcp
    • Reload the firewall:
      • firewall-cmd –reload
  30. Enable HTTPS support with NGINX. here
  31. Restart the NGINX server.
    • sudo /bitnami/wordpresspro-5.2.3-0/ctlscript.sh restart nginx
  32. Force HTTPS redirection with NGINX. here
  33. Enable MySQL SSL connection.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.