migration to docker

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 0mgexj2m
    Junior Member
    • Oct 2025
    • 1

    #1

    migration to docker

    Hello all,
    I'm not sure this is the best place to ask, but I could use some help.
    I have a VM running Turnkey Linux EspoCRM and the host OS is outdated. I'd like to migrate the EspoCRM to a new VM and run EspoCRM as a docker instance.
    I have used AI resources to walk me through backing up the EspoCRM and db files, but getting the db imported has been an issue.
    Is there a guide or any guidance anyone can provide? Essentially, I can't find a way to properly import the dump.sql into the mariadb container.

    There is also an issue with the docker-compose file referenced in the attached link. The actually locations of the EspoCRM files goes to "/var/www/html/var/www/espocrm" which I would assume is incorrect.

    Thanks!
  • lazovic
    Super Moderator
    • Jan 2022
    • 1181

    #2
    Hi 0mgexj2m,

    The following instructions are best suited for this case: https://docs.espocrm.com/administrat...-from-v1-to-v2.

    In step 1, you export the database, and in step 2, you need to copy /data and /custom directories from your old EspoCRM instance. This means that by the time you begin step 3, you should have two folders and an SQL database dump file.

    You shouldn't have any problems completing the next steps, but if you do, please let us know.

    Comment

    • ThomasB
      Senior Member
      • Mar 2022
      • 172

      #3
      I am also in the process to migrate to docker but I have a custom installation.


      You can create a database dump and file backup with the backup script. https://docs.espocrm.com/administrat...p-and-restore/


      To import the DB in my case I did the following.

      I started only the mariadb docker image (commented out the web app in the compose file)

      I copied the db.sql file from the backup to the folder where the docker image stores the data of the db.

      Enter the mariadb docker image:

      Code:
      docker exec -it name_of_stack bash

      Code:
      mariadb -u db_user -p db_name < /var/lib/mysql/db.sql
      Enter the password of the DB and wait
      When done leave with exit.

      You can delete the db.sql file from the dirctory.
      Last edited by ThomasB; 10-15-2025, 10:23 AM.

      Comment


      • 0mgexj2m
        0mgexj2m commented
        Editing a comment
        This is similar to my last attempt, but I tried a mariadb only instance and mirrored the espocrm deployment settings. I'll try it your way.
        Are you using a docker-compose file? If so, did you see the same path issue "/var/www/html/var/www/espocrm" by using the supplied docker-compose guide? I'm not docker expert, so this may be an easy fix, but I can't seem to get the proper path.
        Thanks!!
    • ThomasB
      Senior Member
      • Mar 2022
      • 172

      #4
      I am using docker in swarm mode but the compose file is more or less the same. I'm not sure where you see your path?

      Code:
      ...
      espocrm-db:
      ...
      volumes:
      - db:/var/lib/mysql​
      ...
      Code:
      espocrm​:
      ...
      volumes:
      - data:/var/www/html
      ...
      ​
      maybe post you docker-compose file without passwords etc

      Comment

      Working...