zammad / zammad-docker-compose

Zammad Docker images for docker-compose
https://hub.docker.com/r/zammad/zammad-docker-compose/
GNU Affero General Public License v3.0
273 stars 223 forks source link

Zammad wont move storage from DB to File #389

Closed migasQ closed 10 months ago

migasQ commented 10 months ago

Infos

Expected behavior

Actual behavior

Steps to reproduce the behavior

root@xxx:~/zammad# docker-compose -f docker-compose.yml -f docker-compose.prod.yml exec zammad-railsserver rails c
I, [2023-12-07T17:58:59.201150 #70]  INFO -- : ActionCable is using the redis instance at redis://zammad-redis:6379.
I, [2023-12-07T17:58:59.218559#70-6000]  INFO -- : Using memcached as Rails cache store.
I, [2023-12-07T17:58:59.219381#70-6000]  INFO -- : Using the Redis back end for Zammad's web socket session store.
Loading production environment (Rails 7.0.8)
[1] pry(main)> Store::File.move('DB', 'File')
=> true
[2] pry(main)> exit
mgruner commented 10 months ago

@migasQ I believe it is related to using docker exec rather than docker run. This leads to missing ENV variables, which in turn leads to nulldb being used as database driver. Please use docker run instead and it should work.

mgruner commented 10 months ago

https://docs.zammad.org/en/latest/install/docker-compose.html - How to run rails/rake commands in containers

migasQ commented 10 months ago

Thanks for your prompt response! That was indeed the issue. I did a merge request for a docu extension to run an interactive rails shell with ENV set because I don't like running commands blindly without autocomplete, etc. The merge request is here: https://github.com/zammad/zammad-documentation/pull/404

migasQ commented 10 months ago

And another comment: The backup script does not backup the file storage. I made a proposal for the backup schript so that the full /opt/zammad folder is included: https://github.com/zammad/zammad-docker-compose/pull/390