How to prevent my code edits from being overwritten

I’ve changed a lot of code in my Zammad installation. Changes to .coffee templates, changes to .rb files, etc.
I just found out that all of my changes have been overwritten in my production environment with the defaults.
I suppose this happens after the service restarts and it generates codes files again. But I cannot figure out where the original code files then come from.

How do I adapt my Zammad properly without rebuilds / updates overwriting my work?

Use the template that you’ve removed. With the level of information you’ve provided nobody will be able to help you.

Sure, please forgive my ignorance. I thought that my question would be version independent.

Infos:

  • Used Zammad version: 6.4.0-1733218289.f0be8813.bookworm
  • Used Zammad installation type: package
  • Operating system: Ubuntu 12 Bookworm
  • Browser + version: (irrelevant)

Expected behavior:

  • Files in ./app and ./config to remain the same after I change them

Actual behavior:

  • My changes are overwritten

Steps to reproduce the behavior:

  • Make changes to files in ./app or ./config, and then… wait? Honestly I’m not sure when the files are overwritten.

Generally, if you change source code files from Zammad, your changes will be overwritten during an upgrade. You can re-apply them if you need (at your own danger etc etc). Docker based installations will kill your changes upon every restart.

Package your changes into an addon, it will reduce your pain.

Thanks for the clarification.

How would I go about creating an addon that can enhance the config and makes changes to coffee templates?
examples of changes I need to have and be preserved after upgrades:

  • CSP changes I made in ./config/initializers/content_security_policy.rb
  • Changed render logic in ./assets/javascripts/app/controllers/article_view/item.coffee
  • Additional styling in ./app/assets/stylesheets/zammad.scss

There’s a very good and comprehensive write up that should answer all of your questions here, in our community:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.