Closed andreschmitten94 closed 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:
After you have created the PIM project, inside the pim
folder create a new file compose.override.yml
that will add two more volumes:
services:
mysql:
volumes:
- './data/mysql:/var/lib/mysql'
elasticsearch:
volumes:
- './data/elasticsearch:/usr/share/elasticsearch/data'
I've chosen to store persistent data in the
./data
folder, which resides in the same directory where you execute the PIM. Feel free to customize this location to suit your needs.
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
make dev
or make prod
to create the initial data, after that, you need to modify the Makefile
file by disabling the import of the Dataset:
...
pim-prod:
...
# Comment out the following line to disable the Dataset import
# APP_ENV=prod $(MAKE) database O="--catalog vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/InstallerBundle/Resources/fixtures/minimal"
...
pim-dev:
...
# Comment out the following line to disable the Dataset import
# APP_ENV=dev $(MAKE) database O="--catalog vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/InstallerBundle/Resources/fixtures/icecat_demo_dev"
...
thank you for your answer. I found a similiar by using the mysqldump in the makefile.
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.