EspoCRM in Docker - Update - Best approach

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MarcoMarkl
    Junior Member
    • Oct 2022
    • 1

    EspoCRM in Docker - Update - Best approach

    We are planning to run EspoCRM using Docker. We have already set up a test environment and it works as expected.

    Sample
    Code:
    espocrm:
    image: espocrm/espocrm
    container_name: espocrm
    environment:
    ESPOCRM_DATABASE_HOST: mysql
    ESPOCRM_DATABASE_USER: espocrm
    ESPOCRM_DATABASE_PASSWORD: database_password
    ESPOCRM_ADMIN_USERNAME: admin
    ESPOCRM_ADMIN_PASSWORD: password
    ESPOCRM_SITE_URL: "http://localhost:8080"
    volumes:
    - espocrm:/var/www/html
    restart: always
    ports:
    - 8080:80​
    Now the question is how to perform future updates of EspoCRM. Especially the configuration.

    How do you guys do that? From my point of view there are two strategies.

    Store the complete configuration using "enviroment".
    E.g. ESPOCRM_CONFIG_EXPORT_DISABLED : false
    Has however the crucial disadvantage that here no arrays are possible. So you can not map the complete configuration.

    Or

    Save the "config.php" externally and map the file additionally into the container. But this has the disadvantage that changes to the structure of "config.php" will not be taken into account during an update.

    What do you think? Maybe a third idea?

    Best regards
    Marco
  • DashingUno
    Member
    • Apr 2022
    • 45

    #2
    Hi Marco, we have a simmilar question, so far we came up with 2 solutions:
    1) Upgrade under container root console using default upgrade commands (but that only works if you have 1 container otherwise its tedious, and as long as the php version is supported) - so, this is possibly the worst way to upgrade I reckon, we use it on testing envs.
    2) Since we have daily backups of data and MariaDB anyway, after new container is spun up - a script executes backup restore to the new container - we use this one in production

    But honetsly I dont like both of these ways, maybe someone has a better solution

    Comment

    • mfuermann
      Junior Member
      • May 2021
      • 5

      #3
      Hi Marco,

      I just tried a ... pragmatic way.
      It seems to be enough to check for config changes and changes in dockerfile and than to just chainge the version of the docker image
      (for production I never use latest, I always specify the version to have control over updates)


      A few minutes ago my Espo containers ran with v7.0.7

      1) I stopped the containers with `docker-compose down`
      2) I made a full backup of the data directories with `cp -rp` (preserving permissions)
      3) I changed the image tag for the espocrm docker image from 7.0.7 to 7.2.7
      4) I launched it again with `docker-compose up -d; docker-compose logs -f`

      In the log output I saw the update script doing some work like
      > Start upgrading process from version 7.0.9.
      > ...
      > Upgrade process is finished. EspoCRM version is 7.2.7.

      And now, after logging in, the UI reports me as version 7.2.7

      So thanks to the espo team for the nice auto-update script in the docker images

      Comment


      • DashingUno
        DashingUno commented
        Editing a comment
        That seems like a nice way to do it, will test it mid february and write back if that worked for us as well

      • gabri-ele
        gabri-ele commented
        Editing a comment
        Just tested this and works like a charm; I will only add that if you have "latest" tag you only need to perform a docker-compose pull to download the newest release instead of changing the tag. Cheers
    • viamasrl
      Junior Member
      • Mar 2023
      • 4

      #4
      Anyone could tell me what is the procedure to simply renew let's encrypt certificate on Espocrm when I choose to install with docker?

      Comment

    • viamasrl
      Junior Member
      • Mar 2023
      • 4

      #5
      Originally posted by viamasrl
      Anyone could tell me what is the procedure to simply renew let's encrypt certificate on Espocrm when I choose to install with docker?
      But in that way I will loose every customization? I need instead only update let's encrypt certificate without upgrade or reinstall nothing

      Comment


      • DashingUno
        DashingUno commented
        Editing a comment
        You 99.9% wont lose anything, the 0.01% is if you choose some wierd way to install LS, even then I can't see how that would mess anything with the installation - especially if you do it through reverse proxy
    Working...