Problem with manager.conf

Hello.
We have 2 FreePBX servers. When we make backup from one (main) server and after this we make restore backup to the second server we see a problem in file /etc/asterisk/manager.conf.
FreePBX change field [ami_adm] to [amp_admin] and after this I can not connect to FreePBX GUI.

Original file (one first server) is:
[amp_admin]
secret = secret1
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting$
write = system,call,log,verbose,command,agent,user,config,command,dtmf,reportin$
writetimeout = 5000

[ami_adm]
secret = secret2
deny=0.0.0.0/0.0.0.0
permit=192.168.0.0/255.255.0.0
read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting$
write = system,call,log,verbose,command,agent,user,config,command,dtmf,reportin$
writetimeout = 5000

After restore we have file (on second server):
[amp_admin]
secret = secret1
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting$
write = system,call,log,verbose,command,agent,user,config,command,dtmf,reportin$
writetimeout = 5000

[amp_admin]
secret = secret2
deny=0.0.0.0/0.0.0.0
permit=192.168.0.0/255.255.0.0
read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting$
write = system,call,log,verbose,command,agent,user,config,command,dtmf,reportin$
writetimeout = 5000

Why FreePBX makes this changes? How can we solve this problem?

The first thing that I’d try is switching their order in the first file, so that [ami_adm] is first. Second, is there a reason that this file needs to be copied often? Maybe exclude this from your cloning?

Otherwise, you may have to try a small cron script that looks for this and replaces the second one with the correct name (using a combination of grep and sed, I’d imagine)

The cause may be a difference in distros between the two servers, but that’s my only idea there.

Hello.
“The first thing that I’d try is switching their order in the first file, so that [ami_adm] is first.” I tested it, it`s not working.

“Second, is there a reason that this file needs to be copied often? Maybe exclude this from your cloning?” - It`s not often, but sometimes we make it.

I think this is functional of FreePBX and it must work correctly.)

What if you try moving the original file to a backup before copying the new one? Maybe amportal chown after it’s copied, too, for good measure?

That’s a tilde before date and between the single/double quote at the end (the key below ESC on US keyboards :smiley:)