How to Upgrade Your Amazon Instance

    IMPORTANT: If you want to upgrade your Amazon Image because a security issue, please check our specific Wiki page to know how to address this issue in your current instance.

    - 2014-09-25  Shellshock


    This guide describes the general process to upgrade from an older Bitnami Amazon Machine Image (AMI) version to a newer one. We have also put together a few application-specific guides for the most popular Bitnami applications:

    WordPress instance

    Drupal instance

    Joomla! instance

    Before beginning the upgrade process, we recommend that you make a backup of your current instance. While this is not strictly required and you will not actually be applying updates to your current instance, we still recommend that you make a backup before beginning any procedure. To do so:

    After you have made a backup, you will be ready to move your data and IP address from an instance running an older AMI to one that is running a new one.

    Step 1: Backup Your Files

    First, you will need to create a backup of the files on your instance.  To do so:

    1. Connect to your instance as explained in the link above.
    2. Create a backup of your MySQL or PostgreSQL database. The default database root password is "bitnami". If you are using Bitnami Cloud Hosting, the password is the one that you specified during the server launch process. If you did not specify a password at that time, one was automatically generated for you. In that case, you can retrieve it by going to Servers -> Manage and then click on "show" in the Application Password row to display your password. You can also create a backup through the phpMyAdmin interface.
      • For MySQL, issue the following command (replace “wordpress” with the name of your app, such as “drupal”, “redmine”, etc.):
    $ mysqldump -u root -p bitnami_wordpress > /home/bitnami/wordpress_backup.sql
    • For PostgreSQL, issue the following command (replace “wordpress” with the name of your app, such as “drupal”, “redmine”, etc.):
    $ pg_dump -U postgres bitnami_wordpress > /home/bitnami/wordpress_backup.sql


    1. Create a backup of any uploaded images, themes and plugins.
      • For PHP applications (Drupal, Wordpress, Joomla! and others. Replace “wordpress” with the app name and “wp-content” with the name of the file where the data is saved):
    $ cd /opt/bitnami/apps/wordpress/htdocs
    $ sudo tar -czvf /home/bitnami/wp-content_backup.tar.gz wp-content

    Note that this folder depends on the application itself and you may have to create a backup of several folders for plugins, themes and files.

    • For Ruby applications (Redmine, Spree, Tracks, Typo), the files will be in a different folder depending on the application that you are backing up. You will need to identify which folder this is and back up the appropriate one. The steps will look similar to (replace “redmine” with the app name):
    $ cd /opt/bitnami/apps/redmine
    $ sudo tar -czvf /home/bitnami/files_backup.<wbr>tar.gz files
    • For Java applications (Alfresco, JasperReports Server, Liferay, etc), the uploaded images, themes or plugins are saved in the "data" folder. To make a backup (replace “alfresco” with the app name):
    $ cd /opt/bitnami/apps/alfresco/
    $ sudo tar -czvf /home/bitnami/data_backup.tar.gz data


    1. Create a backup of the configuration files. If you have configured your app to run in the root URL, you may have modified some of the configuration files. To copy the configuration files of PHP or Ruby applications, use the following command:
    $ cd /opt/bitnami/apps/wordpress/
    $ sudo tar -czvf /home/bitnami/conf_backup.tar.gz conf

    There is no configuration file to backup for Java applications.


    1. 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), you can either use the "SCP" command to download them or use your preferred sFTP client. For this tutorial, we will use the SCP command line tool:
    $ scp -i /path/to/your/private_key.pem bitnami@old_server:*backup* .


    Tip: You can also send the files from the old one to the new one directly. Assuming both servers were started with the same AWS cloud credentials, you can use the same SSH key to connect to both servers. On your local host, add your ssh key to the SSH agent:

    $ ssh-add /path/to/your/private_key.pem

    Step 2: Move the Data to Your New Instance

    1. Start the new version of the Bitnami AMI. Note that you can also follow these steps to switch to an AMI with a different operating system or version. 
    1. Upload the files to the new instance. To upload the database backup and files that you downloaded in the first section to the new instance, use the sFTP client:
    $ scp -i /path/to/your/private_key.pem wordpress_backup.sql wp-content_backup.tar.gz wordpress_backup.conf bitnami@new_server:

    Note that will need to upload all of the folders that you previously downloaded with plugins, themes and files.

    1. Restore the database and other files in the new instance.
      • Restore the database. Populate the new application with your data from the previous installation (replace wordpress” with the app name):
    $ mysql -u root -p bitnami_wordpress < /home/bitnami/wordpress_backup.sql
    • Restore the Application filesIf you want to restore the previously installed plugins, themes or the uploaded files, you can uncompress the backed uptarball that you created previously in the old server (replace the app and file names as appropriate):
    $ sudo tar -xzvf /home/bitnami/wp-content_backup.tar.gz -C /opt/bitnami/apps/wordpress/htdocs
    • Restore the configuration filesIf you have customized the application configuration, restore the Apache configuration file (replace wordpress” with the app name):
    $ cp /home/bitnami/wordpress_backup.conf /opt/bitnami/apps/wordpress/conf


    • Restart the servers. To restart the servers on your new instance, issue the following:
    $ sudo /opt/bitnami/ restart

    Step 3: Move Your IP Address

    Once your new instance is up and running with all of your files, you will probably want to point your IP address from the old server to the new server.  Please see this article for details on how to do so.

    Tag page (Edit tags)
    • No tags
    Page statistics
    45048 view(s), 10 edit(s) and 10860 character(s)


    You must login to post a comment.

    Attach file