Bitnami make it easy to deploy open source applications. In this article you will learn the upgrade process of a bitnami wordpress image to a newer version.
Bitnami make it easy to deploy open source applications in public clouds (AWS, Azure or GCP), docker images and virtual machines for hundreds of applications. These images come with pre-installed, optimized and secured applications. They also provide additional tools like Let’s encrypt free HTTPS certificate generator or automatic disk expand/shrink on reboot to help you accelerate your build.
If you used AWS Lightsail service to build a linux server, you most likely came across a bitnami application images such as LAMP, Wordpress and MySQL.
Bitnami images are often built on top of debian, so they have apt as the package manager. However, bitnami packages cannot be updated through apt store. The upgrade process is completely manual. In this article you will learn the upgrade process of a bitnami image to a newer version.
I will be using Wordpress bitnami image for AWS cloud as an example, but you can replicate the following steps for similar images running Apache, PHP, MySQL or Mariadb. For cross platform migrations (Apache to NGINX or vice versa) you may need additional steps due to different configuration syntax.
If you are using extended firewall in your application such as Wordfence extended protection, it’s recommended to disable this option temporarily.
SSH to the old bitnami server using an SSH client.
Stop all services and start mysql or mariadb to do the database backup:
1
2
3
sudo /opt/bitnami/ctlscript.sh stop
sudo /opt/bitnami/ctlscript.sh start mariadb
sudo /opt/bitnami/ctlscript.sh status
Execute mysqldump command to backup the application database named bitnami_wordpress into a file named mysqldump2023.sql, and enter MySQL/Mariadb root password (located at /home/bitnami/bitnami_credentials):
1
2
cd /home/bitnami
sudo mysqldump -u root -p bitnami_wordpress > mysqldump2023.sql
Compress Wordpress main directory while maintaining symlinks:
1
2
cd /opt/bitnami/wordpress/
sudo zip -r /home/bitnami/optbitnami.zip * --symlinks
Compress Wordpress media directory:
1
2
cd /bitnami/wordpress/
sudo zip -r /home/bitnami/bitnami.zip *
Deploy new bitnami server from AWS marketplace or Lightsail console. Feel free to change CPU, RAM and disk size if you need to. Upload the new instance key file pem into the old server’s /home/bitnami directory. In summary the old server’s /home/bitnami directory should have these following 4 files:
1
2
3
4
5
cd /home/bitnami
mysqldump2023.sql
optbitnami.zip
bitnami.zip
newkey.pem
Fix newkey.pem key permissions in old server:
1
chmod 600 newkey.pem
Use scp to transfer the backup files from old to new server, where 34.228.112.230 represents new public server IP address. Since scp is an encrypted protocol we are not worried about using the server private IP for file transfer: