Last active 1749156079

Code snippet to create linked storage directories for Zammad. As shown in https://youtu.be/EorlfrN6n60

1-zammad-move-storage-files-to-linked-folder.sh Raw
1# Below only works if you have no /opt/zammad/storage folder yet and
2# still use the default "DB" setting for the storage_provider
3mkdir /opt/zammad_storage/
4ln -s /opt/zammad_storage/ /opt/zammad/storage
5chown zammad:zammad /opt/zammad_storage/
6chmod 700 /opt/zammad_storage/
7
8# Change to File storage and move said files from DB to File
9# omit 'zammad run' on non package installations
10zammad run rails r "Setting.set('storage_provider', 'File')"
11zammad run rails r "Store::File.move('DB', 'File')""
12
2-zammad-move-storage-files-to-linked-folder-existing-files.sh Raw
1# Below works with existing data storage. STOP Zammad during below operation
2mv /opt/zammad_storage/ /opt/zammad_storage/
3ln -s /opt/zammad_storage/ /opt/zammad/storage
4chown zammad:zammad /opt/zammad_storage/
5chmod 700 /opt/zammad_storage/
6