Requirements:
Phraseanet Docker stack up and running. For more information on how to install Phraseanet with Docker go to https://github.com/alchemy-fr/Phraseanet#phraseanet-with-docker.
A dump of the application box and databoxes of the Phraseanet install you wish to migrate (“db_name_of_the_databox”).
A backup of the following directories:
A backup of your previous configuration file (config/configuration.yml).
Copy your lazaret, download, custom and datas directories to the new destination on your Phraseanet fresh install (take note of the path define inside your env.local file).
ex:
cp -r ~/Phraseanetv.4.0/datas/ ~/Phraseanetv.4.1/datas/
Warning
When copying datas directly inside the fpm container, the operation should be performed as the user app:app.
Import the ab and dbs to the mysql container using the following commands:
Ab:
docker exec -i <mysql_container_id> mysql -uuser -ppass <ab_name_of_the_applicationbox_to_import>.sql < <db_name_of_the_applicationbox_to_import>.sql
Dbs:
docker exec -i <mysql_container_id> mysql -uuser -ppass <db_name_of_the_databox_to_import>.sql < <db_name_of_the_databox_to_import>.sql
Apply the changes to the newly imported ab and dbs to reflect the configuration inside your env.local:
On the ‘Sbas’ table in the application box report the changes made inside the env.local in accordance to the env variables:
docker exec -i <mysql_container_id> mysql -uuser -ppass -e "USE <ab_name>; UPDATE sbas SET host='db', dbname='dbname', user='user', pwd='pwd';"
Change the storage path to reflect the paths defined inside your env.local on your dbs:
docker exec -i <mysql_container_id> mysql -uuser -ppass -e "USE <db_name_of_the_databox>; UPDATE subdef SET path=REPLACE(path,'<OLD_PATH>','<NEW_PATH>');"
docker exec -i <mysql_container_id> mysql -uuser -ppass -e "USE <db_name_of_the_databox>; UPDATE pref SET value=REPLACE(value,'<OLD_PATH>','<NEW_PATH>') WHERE prop='structure';"
Copy and pass the key from the older configuration.yml file inside the newly created configuration file:
nano config/configuration.yml
main:
key: mysecretkey
...
dbname: <ab_name>
Then compile the configuration from the worker container. You might have to upgrade the application before generating the configuration-compiled.php, see the “Upgrade the application” section to do so.
dc -f docker-compose.yml run --rm worker bin/console comp:conf
Launch the “builder” container and lauch the upgrade:
dc -f docker-compose.yml run --rm worker bin/setup system:upgrade
You can then populate the index using the builder container with:
dc -f docker-compose.yml run --rm worker bin/console searchengine:index -p