Errors When Moving FreePBX to New Server

FreePBX Version: 12.0.74
Asterisk Version: 11.17.1

I made a Full Backup of this system in a VM I have on my computer. I want to restore that backup to a physical server for production use. I have the same version installed on the server and I downloaded the Full Backup from my VM and restored it to the new server. After the backup is restored and when trying to apply the new config I get an error retreive_conf not applied and shows the dbpass for the original server. I have looked and tried changing the amportal.conf, cdr_mysql.conf and freebpx.conf to show the same password as the original VM used (as suggested by one forum). Once I change those I get this error.

FATAL ERROR

DB Error: connect failed

Trace Back

/var/www/html/admin/libraries/db_connect.php:71 die_freepbx()
[0]: DB Error: connect failed

/var/www/html/admin/bootstrap.php:91 require_once()
[0]: /var/www/html/admin/libraries/db_connect.php

/etc/freepbx.conf:9 require_once()
[0]: /var/www/html/admin/bootstrap.php

/var/www/html/admin/config.php:99 include_once()
[0]: /etc/freepbx.conf

If I change the passwords back, I can then log into the server and all of my settings and data are there but then get the retreive_config error.

Does anyone know what I need to do to fix this issue?

Thank You

Start MySQL. It’s not running.

I stopped mysql using service mysqld stop, changed the passwords to what they are in the VM and then started mysql using service mysqld start. Tried logging in again and gives same database errors. I changed the AMPDBPASS in /etc/freepbx.conf /etc/amportal.conf and /etc/asterisk/cde_mysql.conf. Are there any other files that I need to update the password in that maybe I am missing? Thank you for your reply

That error is saying that MySQL isn’t running. Is the AMPDBHOST variable set incorrectly in /etc/freepbx.conf?

I checked to make sure everything was exactly the same in both systems with the freepbx.conf. I finally just used clonezilla and cloned the VM to the physical server.