Update with custom files

Status
Not open for further replies.

s2svoip

Member
Dec 9, 2019
259
8
18
44
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 ?
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
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:
Code:
git status

If it is just the file you mention, make sure you have a backup copy and then restore the original file with:
Code:
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.
 

ad5ou

Active Member
Jun 12, 2018
892
204
43
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.
 
  • Like
Reactions: Adrian Fretwell

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
@ad5ou You make a very good point. I seem to remember Mark saying there was a correct place to put customized provision templates, but I can't remember the details - maybe I imagined it, or maybe it is exactly what you suggest. :)
 

s2svoip

Member
Dec 9, 2019
259
8
18
44
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
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
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.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
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:

/etc/fusionpbx/resources/templates/provision

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.
 

ad5ou

Active Member
Jun 12, 2018
892
204
43
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:

s2svoip

Member
Dec 9, 2019
259
8
18
44
I gave it a test and it worked perfectly, I copied the entire directory for the handset then made my custom changes to the cfg file. cheers!
 
  • Like
Reactions: mickey
Status
Not open for further replies.