Backup restore

Status
Not open for further replies.

ad5ou

Active Member
Jun 12, 2018
892
205
43
https://docs.fusionpbx.com/en/latest/getting_started/restore.html is official public documentation but makes a few assumptions of where backup is coming from.

The important part is to have a working fresh install then extract backup files in place of default install then restore database

Code:
tar -xvpzf /var/backups/fusionpbx/backup_filename.tgz -C /

Code:
remove the old database
psql --host=$database_host --port=$database_port  --username=fusionpbx -c 'drop schema public cascade;'
psql --host=$database_host --port=$database_port  --username=fusionpbx -c 'create schema public;'
#restore the database
pg_restore -v -Fc --host=$database_host --port=$database_port --dbname=fusionpbx --username=fusionpbx /var/backups/fusionpbx/postgresql/fusionpbx_pgsql_$now.sql

#restart freeswitch
service freeswitch restart

The pg_restore command above needs proper database host/port and file name of the database backup to work.
 

jonbanega

New Member
May 2, 2022
6
0
1
26
https://docs.fusionpbx.com/en/latest/getting_started/restore.html is official public documentation but makes a few assumptions of where backup is coming from.

The important part is to have a working fresh install then extract backup files in place of default install then restore database

Code:
tar -xvpzf /var/backups/fusionpbx/backup_filename.tgz -C /

Code:
remove the old database
psql --host=$database_host --port=$database_port  --username=fusionpbx -c 'drop schema public cascade;'
psql --host=$database_host --port=$database_port  --username=fusionpbx -c 'create schema public;'
#restore the database
pg_restore -v -Fc --host=$database_host --port=$database_port --dbname=fusionpbx --username=fusionpbx /var/backups/fusionpbx/postgresql/fusionpbx_pgsql_$now.sql

#restart freeswitch
service freeswitch restart

The pg_restore command above needs proper database host/port and file name of the database backup to work.
psql: error: FATAL: Peer authentication failed for user "fusionpbx" getting this error can you help
 

ad5ou

Active Member
Jun 12, 2018
892
205
43
You need the database password.
Depending on how the fresh install was done, you may need to reset it to match the old password, or make a few changes after the restore.

The database password can be fount in /etc/fusionpbx/config.php on a working setup. If installed without customizations from install script, the database password will be random for each installation.

Code:
grep db_password /etc/fusionpbx/config.php | cut -d "'" -f2
will help you find the expected database password.
 

NVGcom

Member
Apr 29, 2020
41
4
8
48
Hi,

The file now is config.conf so the Documentation is outdated.
Just do
Code:
cat /etc/fusionpbx/config.conf | grep password
 
Status
Not open for further replies.