Update with custom files

I dont have any experience with git, but I went to try and upgrade via the GUI and it warns of some changes I have made to resources/templates/provision/yealink/t54w/{$mac}.cfg which is true. it wont upgrade because of this. whats the best process to handle this, I looked up how to use git stash and such but the commands dont work, dont think I understand it fully. anyone make any recommendations ?
Git stash is probably the correct way to go but unless someone has a better idea, I would say the simplest way to resolve this is:

Backup any changes you have made. Its always good practice to make backups before doing anything!

Change directory to /var/www/fusionpbx

Double check what has been changed with:
git status
If it is just the file you mention, make sure you have a backup copy and then restore the original file with:
git checkout -- resources/templates/provision/yealink/t54w/\{\$mac\}.cfg
If you wish, you can compare the differences between the restored file and your backup using diff.

You should be good to go now with the upgrade, but remember to backup, and that includes the database.


Active Member
I'd also add the note to copy any templates to a custom folder if you plan to edit them.
For example copy resources/templates/provision/yealink/t54w/
to resources/templates/provision/yealink/custom/t54w/
You would need to select the new template for each device but it avoids upgrade conflicts. Much easier if you copy things to a custom folder before they are assigned to devices.
cheers @Adrian Fretwell - my deployment is virtual, so I tend to backup with a snapshot - any reason this is not a good idea ?

@ad5ou - I like that idea, I found if you nest it 2 levels deep in yealink/custom/t54w it does not show in the list of selectable templates, so I went with yealink/t54w-custom and put it in there. do you need to copy all the files for that or just the {$mac}.cfg
so I tend to backup with a snapshot - any reason this is not a good idea ?
Snapshots are fine, I use them. Restoring a whole snapshot just seems to be overkill if all you need to restore is a couple of files. Having said that, depending on the type of snapshot and the type of virtualisation platform, it may be possible to mount a snapshot as storage and pull individual files out.
I seem to remember Mark saying there was a correct place to put customized provision...
I can't remember where I read/heard this but looking at the provision.php source code, for a Linux system, it tests for the existence of this directory:


If it does exists, it uses this as the templates directory. So I'm guessing, if you copied your template hierarchy there, and then made your own modifications to it, an upgrade would update templates in the www/fusionpbx structure but not overwrite your customized templates in the /etc/fusionpbx structure.


Active Member
Both of you are correct. I usually make the model name directory a custom name instead of adding another level. I typed it wrong on my first reply.
The alternative method is to drop them in /etc/fusionpbx but I started renaming template directories before I heard about the other way and find it easier to keep track of what has a custom template and what doesn't.
Last edited: