Unable to apply config after restore from backup


#1

Hello,

I have backed up my existing on prem server, then restored the back up to a new server. Same version.

All went well except I cant reload / apply config after the restore. I get the following error below, the weird thing is that the error displays my old DB password from the target server even though the /etc/freepbx.conf and /etc/asterisk/cdr_mysql.conf have the same NEW password on the destination server, im not sure where the error below is getting the old password and where to update it to the new password that was assigned when the distro was installed on the new server. I hope that makes sense :smile:

P.S. the new destination server from the restore is hosted freepbxhosting.com

Reload failed because retrieve_conf encountered an error: 1

exit: 1
[FATAL] SQLSTATE[28000] [1045] Access denied for user ‘freepbxuser’@‘localhost’ (using password: YES) SQLSTATE[28000] [1045] Access denied for user ‘freepbxuser’@‘localhost’ (using password: YES)

Trace Back:

/var/www/html/admin/libraries/BMO/Database.class.php:70 PDO->__construct()
[0]: mysql:host=localhost;port=3306;dbname=asteriskcdrdb
[1]: freepbxuser
[2]: **** OLD PASSWORD IS HERE

/var/www/html/admin/modules/cdr/Cdr.class.php:35 Database->__construct()
[0]: mysql:host=localhost;port=3306;dbname=asteriskcdrdb
[1]: freepbxuser
[2]: **** OLD PASSWORD IS HERE

/var/www/html/admin/libraries/BMO/Self_Helper.class.php:116 Cdr->__construct()
[0]:

/var/www/html/admin/libraries/BMO/Self_Helper.class.php:36 Self_Helper->autoLoad()
[0]: Cdr

/var/www/html/admin/libraries/BMO/Hooks.class.php:163 Self_Helper->__get()
[0]: Cdr

/var/www/html/admin/libraries/BMO/Hooks.class.php:37 Hooks->preloadBMOModules()

/var/lib/asterisk/bin/retrieve_conf:26 Hooks->updateBMOHooks()


New (Old) Backup/Restore Problems - CDR Database
FATAL ERROR DB Error: connect failed
Error after freepbx restore
Unable to access GUI after restore
Updated to 10.13.66-4 and now my Sangoma A200 card is no longer seen
(Rob Thomas) #2

The CDR Pasword is in Advanced Settings. You’ll need to reset it there.


#3

THANK YOU! I cant find the setting under advanced settings :frowning:


(Rob Thomas) #4

Might be easier just to uninstall the CDR module for the moment


#5

Had a similar problem with this the other day. I found the issue was the old CDR password was stored in the mysql database. (FreePBX did not allow me to update or uninstall the CDR module until I did this first).

Easy fix for it would be to SSH into the PBX and log into mysql:

mysql -u freepbxuser -p

Then select the freepbx database:

use `asterisk`;

Now update the old password to the new one:

update `freepbx_settings` SET `value` = '[New Password]' WHERE `value` = '[Old Password]';

Things should work after this. If not you may need to reload amportal and then try to update the CDR module.

Disclaimer: It’s certainly worth making a backup of your Database before doing this, especially if you don’t understand what you’re doing. You could break something.


Phones not ringing for incoming calls
(Krystyna) #6

Hello,

I recently had this issue. Like @xrobau said, I went into Advanced Settings and removed the remote CDR credentials. I was then able to Apply Config after restoring from a backup.

Thank you!


#7

Advanced Settings - but note that this field (Remote CDR DB Password) is hidden.

Look for DisplayReadONLY and ChangeReadOnly near the top of advanced settings – turn these on
Then change Remote CDR DB Password to your original password (I found my original pw in /etc/asterisk/cdr_mysql.conf)
Then apply ==> joy!

Note that the backup/restore had applied the mysql pw from my original server - but had not replaced the mysql database - so I had to put the pw from my new server into advanced settings to get going again.

this worked for me after I had restored my original asterisk server’s full backup (backup had everything less CDR database) to my new server. - initially after the restore I was unable to apply config - yielding the error which started this thread. Specifically Access denied for user ‘freepbxuser’@’ while trying to apply config after restoring from one server to another one.


(Marbled) #8

Hi!

As @xrobau said in the past, unless you changed something from the default, do not set them, clear them…

If they are emptied out they will take the default values…

Have a nice day!

Nick


(JarJar Swope) #9

I have found the fix for this 100%. Who can I contact at freepbx to fix this issue.

The fix for see below is.

SSH into the freepbx box run commands below

amportal a m

use asterisk

update freepbx_settings SET value = ‘[BlankPassword]’ WHERE value = ‘[Old Password]’;

where '[Blank Password] is blank see below and old password = Password from GUI error

update freepbx_settings SET value = ‘’ WHERE value = ‘[Old Password]’;

[FATAL] SQLSTATE[28000] [1045] Access denied for user ‘freepbxuser’@‘localhost’ (using password: YES) SQLSTATE[28000] [1045] Access denied for user ‘freepbxuser’@‘localhost’ (using password: YES)

Trace Back:

/var/www/html/admin/libraries/BMO/Database.class.php:70 PDO->__construct()
[0]: mysql:host=localhost;port=3306;dbname=asteriskcdrdb
[1]: freepbxuser
[2]: **** OLD PASSWORD IS HERE

/var/www/html/admin/modules/cdr/Cdr.class.php:35 Database->__construct()
[0]: mysql:host=localhost;port=3306;dbname=asteriskcdrdb
[1]: freepbxuser
[2]: **** OLD PASSWORD IS HERE

/var/www/html/admin/libraries/BMO/Self_Helper.class.php:116 Cdr->__construct()
[0]:

/var/www/html/admin/libraries/BMO/Self_Helper.class.php:36 Self_Helper->autoLoad()
[0]: Cdr

/var/www/html/admin/libraries/BMO/Hooks.class.php:163 Self_Helper->__get()
[0]: Cdr

/var/www/html/admin/libraries/BMO/Hooks.class.php:37 Hooks->preloadBMOModules()

/var/lib/asterisk/bin/retrieve_conf:26 Hooks->updateBMOHooks()


Error: Exception (1045) HELP SQLSTATE[28000] [1045] Access denied for user ‘freepbxuser’@’localhost’ (using password: YES)::SQLSTATE[28000] [1045] Access denied for user ‘freepbxuser’@’localhost’ (using password: YES)
OUTAGE: Exception (1045) SQLSTATE[HY000] [1045] Access denied for user 'freepbxuser'@'localhost' (using password: YES)::
(system) closed #11

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