Search code examples
updateslampbitnami

How to update Bitnami LAMP stack?


I'm running a few Bitnami LAMP stacks and so far it's been very convenient and most things work as expected.

I've been searching for information on how to update Apache, MySQL, and PHP. They're installed in the /opt/bitnami/ directory and they don't seem to update when I run:

$ sudo apt-get update

How do you update Bitnami LAMP stacks?

Thanks in advance! :)


Solution

  • Bitnami developer here.

    Please note that our applications are self-contained and that means that our applications bundle all of the libraries, databases, and runtimes required to run on any platform and they don't depends on the components that exist in your system. The way you tried to update the components doesn't work with the Bitnami stacks due to it updates the components of the system.

    You will learn more about Bitnami stacks here.

    If you launched a server with LAMPstack in the cloud you could launch a new server with the latest version of the stack and then migrate the data, however if you installed the stack in a local server you could install the new version of the stack and migrate the data before uninstalling the old version.

    To migrate the data you will need to copy your custom files from the old version to the new one (The php files of your application if you deployed your custom php application, the configuration files of Apache if you modified it, ...) and the data of the database. To migrate the database you will need to create a backup of your databases

    mysqldump -u root -p database_name > backup.sql
    

    And restore it in the new installation

    mysql -u root -p database_name < backup.sql
    

    Please note that you will need to create that database if it's not created.

    mysql -u root -p
    mysql> create database database_name;
    mysql> grant all privileges on database_name.* to 'bitnami'@'localhost'
    identified by 'BITNAMI_USER_PASSWORD';
    mysql> flush privileges;
    mysql> exit;
    

    If you also installed any of the modules that we provide you have to install them in the new installation and migrate the data of the applications. The process depends on each application.

    I hope it helps. Jota