Upgrade a Bitnami Multi-Tier Solution
This section describes the general process to upgrade from an older version of a Bitnami Multi-Tier Solution for AWS to a newer one.
NOTE: By default, SSH is disabled on AWS Multi-Tier Solutions. Before following the steps in this section, enable SSH access as described in the FAQ.
NOTE: Before beginning the upgrade process, we recommend making a backup of your current instances.
Step 1: Backup files
First, create a backup of the files on the application instance. To do so:
Connect to the instance as explained in the FAQ.
Create a backup of the database (refer to the FAQ for more information). Issue the following command (replace APPNAME with the name of your application, such as wordpress or redmine and DBHOST with the host name of your database instance):
$ mysqldump -u root -h DBHOST -p bitnami_APPNAME > /home/bitnami/db_backup.sql
Create a backup of the configuration and data files (such as uploads, plugins or themes) with the following command:
$ sudo tar -czvf /home/bitnami/conf_backup.tar.gz /bitnami
Download the backup files to your machine. To download the backed up files to your local machine (so you can upload them to a new one), open a new terminal window and use the scp command, or use a separate SFTP client.
This tutorial uses the scp command in a new window, as shown below. Remember to replace KEYFILE with the path to the private key file (.pem format) and APPHOST with the public IP address of the application instance. For more information on using an SSH key with scp or an SFTP client, refer to the FAQ.
$ scp -i KEYFILE bitnami@APPHOST:/home/bitnami/conf_backup.tar.gz . $ scp -i KEYFILE bitnami@APPHOST:/home/bitnami/db_backup.sql .
Step 2: Retrieve new database credentials
Start the new version of the Bitnami Multi-Tier Solution for AWS.
Log in to the new instance via SSH.
Obtain and note the database credentials for the new Multi-Tier Solution. Typically, you will find these in a configuration file in the /bitnami/APPNAME/conf directory. The name and structure of the configuration file differs per application; refer to the application’s documentation for more specific information.
Step 3: Transfer data
Upload the files to the new instance. To upload the database backup and files downloaded earlier to the new instance, use the scp command as shown below. Replace KEYFILE with the path to the private key file (.pem format) and NEWAPPHOST with the public IP address of the new application instance:
$ scp -i KEYFILE db_backup.sql conf_backup.tar.gz bitnami@NEWAPPHOST:
Restore the database and other files on the new instance (replace APPNAME with the name of your application, such as wordpress or redmine and DBHOST with the host name of your database instance):
$ mysql -u root -h DBHOST -p bitnami_APPNAME < /home/bitnami/db_backup.sql $ sudo tar -xzvf /home/bitnami/conf_backup.tar.gz -C /
Step 4: Update database credentials
When performing the previous step, the database credentials for the application would have been overwritten with older (incorrect) values. Update the application configuration file with the correct database credentials (obtained in Step 2) for the new Multi-Tier Solution.
Restart the server:
$ sudo service bitnami restart APPNAME
Step 5: Move the IP address
Once the new application instance is up and running with all the files restored, point the old application instance’s IP address to the new application instance.