Maintaining and Upgrading the Portal

How to Backup Server Files #

Locate Server files on:

Cloud Computing Services  |  Google Cloud

Click on VM Instances
Click on the VM you want to back up
Click on Create Machine Image
Name the VM what it is with the MM-DD format and then click CREATE

Upgrade the Portal and the FULL Bitnami Stack #

BEFORE YOU START PUT THE CURRENT PORTAL IN MAINTENANCE MODE.

1 Log in to the server console via SSH.

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

mkdir ~/espocrm-backup

3. Back up the bitnami_espocrm database as described on the MySQL documentation.

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

cp -rf /opt/bitnami/espocrm/data/ ~/espocrm-backup/

While this is going on, use WinSCP to create a backup of the Custom directory located in opt/bitnami/espocrm.

5. Compress the backup directory:

tar cfz espocrm-backup.tar.gz ~/espocrm-backup/

6. Download the backup files espocrm-backup.tar.gz and backup.sql using SFTP.

7. Launch a new EspoCRM server with the latest version.

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

9. Log in to the new server console via SSH.

10. Restore the database backup as described on the MySQL documentation.

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

sudo tar xfz espocrm-backup.tar.gz --totals

While this is going on, place the Custom backup folder into the new server’s /bitnami/espocrm. Overwrite current data.

12. Restore the data folder:

sudo cp -rf ~/espocrm-backup/data /opt/bitnami/espocrm/

13. 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

14. Restore the permissions in the data folder:

sudo chown -R daemon:daemon /bitnami/espocrm/data

15. Restart Apache:

sudo /opt/bitnami/ctlscript.sh restart apache

16. Log in to the Portal Dashboard.

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

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

19. Take the new Portal out of maintenance mode, click on “Administration – > Settings”.

20. That’s it! You updated the whole stack. Test the new server and, if everything is fine, delete the old server.

Upgrade CRM ONLY for new EspoCRM Version #

Log in to the server console via SSH on Google Cloud.

Backup the previous application files:

 docs/ 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!

Managing Extensions #

Installing #

In order to install EspoCRM extension:

  1. Login as an administrator.
  2. Go to Administration – > Extensions.
  3. Upload the extension package (zip file).
  4. Click Install button.

Upgrading #

In order to upgrade an already installed extension to a newer version:

  1. Download the new version of the needed extension.
  2. Login as an administrator.
  3. Go to Administration – > Extensions.
  4. Upload the new extension package (zip file) without uninstalling the already installed version.
  5. Click Install button.

There’s NO need to install intermediate versions. Install just the latest one.

Uninstalling #

Steps to uninstall an extension:

  1. Login as an administrator.
  2. Go to Administration -> Extensions.
  3. Find the needed extension on the list of available extensions.
  4. Click Uninstall button.

Deleting #

When an extension is uninstalled, it is still available in the system. It can be completely deleted. Steps to delete an extension:

  1. Login as an administrator.
  2. Go to Administration – > Extensions.
  3. Find the needed extension in the list of available extensions.
  4. Click Remove button.

CLI commands #

Installing & upgrading with uploaded zip file #

cd /opt/bitnami/espocrm/



php command.php extension --file="path/to/extension/package.zip"

How to Launch a New Bitnami EspoCRM Instance #

MySQL (MariaDB) #

Useful MariaDB Commands #

SHOW DATABASES;

Backup #

mysqldump -u root -p bitnami_espocrm > backup.sql  (ROOT PASSWORD FOUND ON BITNAMI VM LAUNCHER)

Recover #

mysql -u root -p -D bitnami_espocrm < backup.sql (ROOT PASSWORD FOUND ON BITNAMI VM LAUNCHER)

Root Password #

Always the Bitnami VM Launcher Password

How to Create a New DB User #

sudo mysql -u root -p
CREATE USER 'bn_espocrm'@localhost IDENTIFIED BY 'PASSWORD';

Check the status of the new user by:

SELECT USER FROM mysql.user;

Grant your new user to access the bitnami_espocrm Database:

GRANT ALL PRIVILEGES ON bitnami_espocrm.* TO 'bn_espocrm'@localhost;

Remove MariaDB User Account #

DROP USER 'user1'@localhost;

Title

Go to Top