Upgrade SRM to the Latest Version via Docker

This page is intended for users who are currently using SRM version 9.0 or later. If you are using a version older than 9.0, do not follow the steps on this page. Instead, please contact our support team for assistance.

Step 1: Review the file structure of the downloaded docker installation package

In this step, you should become familiar with the Docker installation package you downloaded. It can be used either to perform a fresh installation of the latest SRM version or to update an existing version using Docker. The docker installation package should contains the following files and folders:

  • docker_install.sh: A shell script that automates the fresh installation of Smart Report Maker on Linux systems. Use this script only if you’re installing a new version of SRM on a Linux server, not for updating an existing version.
  • docker_install.ps1: A PowerShell script that automates the fresh installation of Smart Report Maker on Windows systems. Use this script only if you’re installing a new version of SRM on a Windows server, not for updating an existing version.
  • docker_update.sh: A script used to update an existing SRM installation that runs as a Docker container on a Linux server.
  • docker_update.ps1: A script used to update an existing SRM installation that runs as a Docker container on a Windows server.
  • includes/: A directory containing all necessary files required for both installation and update processes.
  • .docker-env: An environment file used by the installation script. It contains sensitive information such as passwords, configuration settings, and the tag of the version to be installed.
  • docker-compose.yml: A configuration file required to define the services that will be set up on your system.

Note: The image displays the contents of the Docker installation package.


Step 2: Open your terminal

Log in to the machine where SRM is running as a Docker container.

  • If you are using windows then:
    • Run your PowerShell command prompt as an administrator by following these steps:
      • Select Run as administrator from the context menu.
      • Press the Windows key and type “PowerShell.”
      • Right-click on Windows PowerShell from the search results.
  • If you are using Linux then:
    • Open your terminal

Verify the Docker volumes by running the following command:

docker volume ls

ou should see the following three docker volumes:

  • srm_volume_config: Stores configuration and settings
  • srm_volume_reports: Stores your created reports
  • srm_volume_db: Stores the MySQL database if it’s running in a Docker container

Step 3: Back Up Your Old SRM Version

Before performing the upgrade, it’s crucial to back up both the Docker volumes and the SRM database to ensure you can restore your system if needed.

3.1 Back Up Docker Volumes

To back up these volumes:

  1. Backup the three volumes by running commands like the following:
docker run --rm -v srm_volume_config:/volume -v "${PWD}:/backup" busybox sh -c "tar czf /backup/srm_volume_config_backup.tar.gz -C /volume ."

docker run --rm -v srm_volume_reports:/volume -v "${PWD}:/backup" busybox sh -c "tar czf /backup/srm_volume_reports_backup.tar.gz -C /volume ."

docker run --rm -v srm_volume_db:/volume -v "${PWD}:/backup" busybox sh -c "tar czf /backup/srm_volume_db_backup.tar.gz -C /volume ."

These commands will create .tar.gz backup files in your current folder. You can copy them to a safe location.

The image displays the backup files of the Docker volumes.

3.2 Back Up the Database Using phpMyAdmin

Whether your database is:

  • running inside a Docker container,
  • installed directly on the host machine, or
  • hosted on a remote server,

you should back it up using phpMyAdmin.

Steps:

  1. Open your browser and go to your phpMyAdmin
  2. Log in using your MySQL credentials.
  3. In the left panel, select the database used by SRM.
  4. Click the Export tab at the top.
  5. Choose the Quick method and leave the format as SQL.
  6. Click Go to download the SQL dump file (e.g., srm_backup.sql).

This file contains the full structure and data of your SRM database and is essential for restoring your system later if needed.

With the Docker volumes and database safely backed up, you’re ready to move on to the SRM upgrade process using Docker.


Step 4: Upload the New Version of SRM

4.1 Copy the new Docker installation package to the server where the SRM container is running. it should be something like the following image

The image displays the contents of the Docker installation package.

4.2 Copy the existing docker-compose.yml file from the previous version (it should already be on your server where the SRM containers are running) and include it with the new version’s files, as the updater requires it.

The image shows the contents of the Docker installation package after including the docker-compose.yml file from the previous version.

4.3 We’ve noticed that some antivirus programs may block downloading dependencies. To avoid this issue, if you use an antivirus, please open your antivirus software (e.g., Bitdefender, Avast, Kaspersky, Norton) and look for an option such as:

  • “Pause Protection”
  • “Temporarily Disable Guard”
  • “Turn Off Real-Time Protection”

Choose a temporary duration (e.g., 10 minutes or 1 hour)


Step 5: Execute the Upgrade Script

If you’re using Windows, run PowerShell as an administrator.
If you’re using Linux, open your terminal to run the following commands.

In case of windows:

Navigate to the docker_installation_package

cd "C:\path\to\docker_installation_package_directory"

Verify that docker_update.ps1 appears in the output of the following command.

ls

 Set the PowerShell Execution Policy and run the script

powershell -ExecutionPolicy Bypass -File .\docker_update.ps1

In case of Linux:

Navigate to the docker_installation_package

cd /path_to_docker_installation_package

Verify that docker_update.sh appears in the output of the following command.

ls -ahl

To run the installer, use this command:

bash docker_update.sh

if you encounter an issue due to permissions you can try the following command instead:

sudo chmod +x docker_update.sh && bash docker_update.sh

If the Upgrade Was Not Successful

If something went wrong during the upgrade:

  • Check the update.log file for detailed error messages.
    • Review the .progress file to see how far the process went.
  • You may choose to retry the upgrade or roll back to the previous version using the srm_old folder and your database backup.

Summary

  • You can upgrade SRM version 9.0 or later to the latest version.
  • Versions earlier than 9.0 are not supported by this guide.
  • The upgrade process supports both Linux and Windows systems
  • This post covers the update process, beginning with reviewing the file structure of the Docker installation package and creating a backup of your existing SRM installation. It’s important to keep this backup even after the upgrade, in case anything goes wrong. The final step involves executing the update, with instructions provided for both Linux and Windows.