nativeInstallerespocrm

Upgrade EspoCRM

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

It is strongly recommended that you create a backup before starting the update process. If you have important data, it is advisable that you try to create and restore a backup to ensure that everything works properly.

  • Create a directory to save all the data you need to backup. Use the command below (on Linux and Mac OS X):

    $ mkdir ~/espocrm-backup
    
  • Back up the bitnami_espocrm database as described on the MySQL documentation page.

  • Copy the conf/ and htdocs/data directories to your backup directory. Use the commands below (on Linux and Mac OS X):

    $ cp -rf installdir/apps/conf/ ~/espocrm-backup/conf/
    $ cp -rf installdir/apps/htdocs/data ~/espocrm-backup/data
    
  • Uninstall the previous Bitnami EspoCRM Stack.

  • Download the latest version of the Bitnami EspoCRM Stack and install it.

  • Restore the database backup as described on the MySQL documentation page.

  • Restore the Data directory. Use the commands below (on Linux and Mac OS X):

    $ sudo cp -rf ~/espocrm-backup/data/.data installdir/apps/espocrm/*htdocs/data/.data
    $ sudo cp -rf ~/espocrm-backup/data/cache installdir/apps/espocrm/*htdocs/data/cache
    
  • Update the passwordSalt and the cryptKey properties of the *installdir/apps/espocrm/htdocs/data/config.php file with the value in the ~/espocrm-backup/data/config.php file. To do so, use an editor to modify it manually or the commands below (on Linux and Mac OS X):

    $ sudo cat ~/espocrm-backup/data/config.php | grep -oP "(?<='passwordSalt' => )('.*')" | xargs -I % sed -e "s/'passwordSalt' => '.*'/'passwordSalt' => '%'/g" -i installdir/apps/espocrm/htdocs/data/config.php
    $ sudo cat ~/espocrm-backup/data/config.php | grep -oP "(?<='cryptKey' => )('.*')" | xargs -I % sed -e "s/'cryptKey' => '.*'/'cryptKey' => '%'/g" -i installdir/apps/espocrm/htdocs/data/config.php
    
  • Restore the permissions (only on Linux and Mac OS X if the stack was installed as root).

    $ sudo chown -R bitnami:daemon installdir/apps/espocrm/htdocs/data/
    $ sudo chown -R daemon:daemon installdir/apps/espocrm/htdocs/data/cache installdir/apps/espocrm/htdocs/data/config.php
    
  • Restore the Apache configuration files in the new EspoCRM stack. Use the command below:

    $ sudo cp -rf ~/espocrm-backup/conf/ installdir/apps/espocrm/conf/
    
  • Restart Apache using the graphical manager or the command line script:

    $ sudo installdir/ctlscript.sh restart apache
    
  • Log in to the EspoCRM Dashboard.

  • Under the dropdown menu in the upper right corner, click on “Administration -> Rebuild”.

  • Under the dropdown menu in the upper right corner, click on “About”. Refresh the page and confirm the upgrade from the version shown.

That’s it! You updated the whole stack.

Upgrade only EspoCRM in the Bitnami EspoCRM Stack

  • Backup the previous EspoCRM files and modify the permissions (on Linux and Mac OS X):

    $ cd installdir/apps/espocrm
    $ sudo cp -a htdocs/ htdocs_backup
    $ sudo chown -R daemon:daemon htdocs/
    
  • Browse to the EspoCRM SourceForge page and download the latest version of EspoCRM upgrade pack.

  • Log in to the EspoCRM Dashboard.

  • Under the dropdown menu in the upper right corner, click on “Administration”.

  • Under the Administration menu, click on “Upgrade”.

  • Upload the upgrade pack and follow the wizard to upgrade your EspoCRM installation.

  • Once the upgrade finishes, log in to the EspoCRM Dashboard again.

  • Under the dropdown menu in the upper right corner, click on “Administration -> Rebuild”.

  • Under the dropdown menu in the upper right corner, click on “About”. Refresh the page and confirm the upgrade from the version shown.

  • Once the upgrade is confirmed, restore the permissions (only on Linux and Mac OS X if the stack was installed as root).

    $ cd installdir/apps/espocrm
    $ sudo chown -R bitnami:daemon htdocs/
    $ sudo chown -R daemon:daemon htdocs/data
    $ sudo chown -R daemon:daemon htdocs/custom
    $ sudo chown -R daemon:daemon htdocs/client/custom
    $ sudo find htdocs/ -type d -exec chmod 755 {} + && sudo find htdocs/ -type f -exec chmod 644 {} +;
    $ sudo find htdocs/data htdocs/custom -type d -exec chmod 775 {} + && sudo find htdocs/data htdocs/custom -type f -exec chmod 664 {} +;
    $ chmod 775 htdocs/application/Espo/Modules
    $ chmod 775 htdocs/client/modules
    
  • Delete the htdocs_old directory that was created for backup purposes. Use the command below (on Linux and Mac OS X):

    $ sudo rm -rf htdocs_old
    

That’s it! You updated the application!

Last modification September 5, 2018