akeneo / pim-community-dev

[Community Development Repository] The open source Product Information Management (PIM)
http://www.akeneo.com
Other
950 stars 513 forks source link

Database save on server and load after restart Docker container #20425

Closed andreschmitten94 closed 2 months ago

andreschmitten94 commented 3 months ago

Hello,

i really can not find informations in the documentary of akeneo for this issue.

I installed the version 6 on an ubuntu server and with the make prod command it works. But if i restart the server all data are gone. Also i got the warning should not be executed in production environment.

I know it is because of the command pim:installer:db. When i restart the container it will load the dataset that is empty. How can i save the data persistent?

thanks in advance for your help. Might be a very easy change in the makefile and docker-compose.yml.

Giglium commented 2 months ago

I encountered the same issue. By default, executing the make down command erases the database volume, while every make dev or make prod command triggers Dataset import. To ensure data persistence, following the guide, you should implemented the following changes:

To avoid permission issues you have to create all the folders where you will store the data with the same user you will use for running the PIM. In your example:

mkdir -p ./data/elasticsearch && mkdir ./data/mysql
andreschmitten94 commented 2 months ago

thank you for your answer. I found a similiar by using the mysqldump in the makefile.