generalespocrm

Upgrade EspoCRM

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.

  • Log in to the server console via SSH.

  • Create a directory to save all the data you need to backup:

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

  • Copy the data directory to your backup directory. Use the command below:

      $ cp -rf /opt/bitnami/espocrm/data/ ~/espocrm-backup/
    
  • Compress the backup directory:

      $ tar cfz espocrm-backup.tar.gz ~/espocrm-backup/
    
  • Download the backup files espocrm-backup.tar.gz and backup.sql using SFTP. Refer to the FAQ for more information on this.

  • Launch a new EspoCRM server with the latest version.

  • Upload via SFTP the backup files espocrm-backup.tar.gz and backup.sql to the new server.

  • Log in to the new server console via SSH.

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

  • Uncompress the backup file espocrm-backup.tar.gz and restore the the data directory. Use the commands below:

      $ tar xfz espocrm-backup.tar.gz
    
  • Restore the data folder:

      $ sudo cp -rf ~/espocrm-backup/data /opt/bitnami/espocrm/
    
  • Update the passwordSalt and the cryptKey properties of the configuration file with the value in the ~/espocrm-backup/data/config.php file. To do so, you can use an editor to modify it manually or use the commands below:

      $ sudo cat ~/espocrm-backup/data/config.php | grep -oP "(?<='passwordSalt' => )('.*')" | xargs -I % sed -e "s/'passwordSalt' => '.*'/'passwordSalt' => '%'/g" -i */opt/bitnami/espocrm/data/config.php*
      $ sudo cat ~/espocrm-backup/data/config.php | grep -oP "(?<='cryptKey' => )('.*')" | xargs -I % sed -e "s/'cryptKey' => '.*'/'cryptKey' => '%'/g" -i */opt/bitnami/espocrm/data/config.php*
    
  • Restore the permissions in the data folder:

      $ sudo chown -R daemon:daemon /opt/bitnami/espocrm/data
    
  • Restart Apache:

      $ sudo /opt/bitnami/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. Test the new server and, if everything is fine, delete the old server.

Upgrade only EspoCRM in the Bitnami package for EspoCRM

  • Log in to the server console via SSH.

  • Backup the previous application files:

      $ sudo cp -a htdocs/ htdocs_backup
    
  • Run the upgrade command from the installation folder:

      $ php command.php upgrade
    
  • Delete the htdocs_old directory that was created for backup purposes:

      $ sudo rm -rf htdocs_old
    

That’s it! You updated the application!

Last modification February 9, 2023