fusionpbx restore backup to new server

Status
Not open for further replies.

ParaCon

New Member
Nov 11, 2016
5
0
1
54
Indeed, during startup, freeswitch create same .db files like core.db fifo.db extentions.db ect
i see this files under /var/lib/freeswitch/db directory
I have removed all db files and freeswitch give same errors and after reboot all files have been recreated under /var/lib/freeswitch/db
but problem is not solved

I really don't understand this. Did you have more tips?
 

ParaCon

New Member
Nov 11, 2016
5
0
1
54
problem found
in fusionpbx
core/default_settings/default_settings.php
methode of Cache was memcache
but in vim /etc/fusionpbx/config.lua file was named as file and location was /var/cache/fusionpbx

so if you make changes in fusionpbx web interface, fusionpbx application try remove it from memcache but not from /var/cache/fusionpbx location
and freeswitch look to files in /var/cache/fusionpbx

i have changed now in fusionpbx default settings from memcache to file and it works now
i think maybe better to change both to memcached but I don't know the difference.

Thanks
 

smn

Member
Jul 18, 2017
201
20
18
problem found
in fusionpbx
core/default_settings/default_settings.php
methode of Cache was memcache
but in vim /etc/fusionpbx/config.lua file was named as file and location was /var/cache/fusionpbx

so if you make changes in fusionpbx web interface, fusionpbx application try remove it from memcache but not from /var/cache/fusionpbx location
and freeswitch look to files in /var/cache/fusionpbx

i have changed now in fusionpbx default settings from memcache to file and it works now
i think maybe better to change both to memcached but I don't know the difference.

Thanks

I think file cache is the default now. I don't think you want to have memcached running once you change that setting. If you look in /var/cache/fusionpbx you will see that it is freeswitch config files and dialplan stuff, not web files. So I don't think it is used for speeding up the web interface, it is used to speed up the PBX performance.
 
Last edited:

ZPM

Member
Nov 15, 2017
64
6
8
46
when executing
pg_restore -Fc --host=127.0.0.1 --dbname=fusionpbx --username=fusionpbx /var/backups/fusionpbx/postgresql/fusionpbx_pgsql_$now.sql
I"m getting the following output

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 3; 2615 2200 SCHEMA public postgres
pg_restore: [archiver (db)] could not execute query: ERROR: schema "public" already exists
Command was: CREATE SCHEMA public;


DROP SCHEMA
CREATE SCHEMA
pg_restore: connecting to database for restore
pg_restore: creating SCHEMA "public"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 3; 2615 2200 SCHEMA public postgres
pg_restore: [archiver (db)] could not execute query: ERROR: schema "public" already exists
Command was: CREATE SCHEMA public;

I have done restores successfully many times using the restore script from docs but today I am getting the same exact error as you. Usuing the latest version trying to restore to another host.

1. First I change the PSQL password on the Destination server to be the same as the Source server and update the config.php file and restart and make sure were still talking to the DB.
2. On Source server I have the fusionpbx-backup.sh tested and working
3. On the Destination server have the fusionpbx-restore.sh runs and completes
4. The web inteface is a blank white page and the title is blank <!--{title}-->
 
Last edited:

dev

New Member
Sep 12, 2021
15
0
1
41
Hello Friends

I restored fusionpbx backup to new server but I am not able to list users, and some of default setting values. Not sure why it did not restore completely. Any idea?
 

dev

New Member
Sep 12, 2021
15
0
1
41
I solved it by manually removing the database roles:
DROP ROLE fusionpbx;
DROP ROLE freeswitch;

and than recreating them with the restored database password:
sudo -u postgres psql -c "CREATE ROLE fusionpbx WITH SUPERUSER LOGIN PASSWORD 'restored server password';"
sudo -u postgres psql -c "CREATE ROLE freeswitch WITH SUPERUSER LOGIN PASSWORD 'restored server password';"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE fusionpbx to fusionpbx;"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE freeswitch to fusionpbx;"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE freeswitch to freeswitch;"

and restoring the database:
pg_restore -Fc --host=127.0.0.1 --dbname=fusionpbx --username=fusionpbx /var/backups/fusionpbx/postgresql/fusionpbx_pgsql_$now.sql

thank you
while dropping getting below;

root@testpbx:/var/backups/fusionpbx# psql --host=127.0.0.1 --username=fusionpbx -c 'DROP ROLE fusionpbx;'
Password for user fusionpbx:
ERROR: current user cannot be dropped
root@testpbx:/var/backups/fusionpbx# psql --host=127.0.0.1 --username=fusionpbx -c 'DROP ROLE freeswitch;'
Password for user fusionpbx:
ERROR: role "freeswitch" cannot be dropped because some objects depend on it
DETAIL: privileges for database freeswitch
 

Incubugs

Member
Apr 7, 2018
175
10
18
49
I would add that fusionpbx although great software has an awful backup and restore setup. I would suggest using disk images if the ip is staying the same, or better still use vm's then you can snapshot, restore all that good stuff without worying about what version postgre or what disk you have etc, since i moved to vm's never had an issue.
 
Status
Not open for further replies.