Restore Backed up file configuration

Status
Not open for further replies.

Woodie Wood

New Member
Apr 17, 2017
14
0
1
34
Hi, Masters!

1. I've successfully backed up my configuration on my server and restore it to my new fusionpbx server. I've tried restoring the backed up config using the web GUI, but I always received an error message '413 Request Entity Too Large'. I've edited the php and ngix conf file to add some more space. But when I tried restoring the backup using GUI, I still receive the same error message.

2. Why is it that backup and restore from GUI don't work at all?

Thanks!
 
Hi, You can backup and restore with the following command:
Backup Script:
#!/bin/sh
now=$(date +%Y-%m-%d)
#delete backups older 7 days
find /var/backups/fusionpbx/postgresql/fusionpbx_pgsql* -mtime +7 -exec rm {} \;
find /var/backups/fusionpbx/*.tgz -mtime +7 -exec rm {} \;
#delete freeswitch logs older 7 days
find /usr/local/freeswitch/log/freeswitch.log.* -mtime +7 -exec rm {} \;
echo "Starting Backup"
#backup the database
pg_dump -Fc -h 127.0.0.1 -U fusionpbx fusionpbx -f /var/backups/fusionpbx/postgresql/fusionpbx_pgsql_$now.sql
#mysqldump -u root -pZZZ fusionpbx > /var/backup/fusionpbx/mysql/fusionpbx_mysql_$now.sql
#backup the files and directories
tar -zvcf /var/backups/fusionpbx/pbx1-backup_$now.tgz /var/backups/fusionpbx/postgresql/fusionpbx_pgsql_$now.sql /var/www/fusionpbx /usr/local/fre
eswitch/scripts /var/lib/freeswitch/storage /var/lib/freeswitch/recordings /etc/fusionpbx /usr/local/freeswitch/conf /var/scripts
echo "Backup Complete";

Restore Script:
#!/bin/sh
now=$(date +%Y-%m-%d)
remote_server=162.208.16.3
#delete freeswitch logs older 7 days
find /usr/local/freeswitch/log/freeswitch.log.* -mtime +7 -exec rm {} \;
#message to the console
echo "Restoring the Backup"
#extract the backup from the tgz file
tar -xvpzf /var/backups/fusionpbx/backup_$now.tgz -C /
#remove the old database
psql --host=127.0.0.1 --username=fusionpbx -c 'drop schema public cascade;'
psql --host=127.0.0.1 --username=fusionpbx -c 'create schema public;'
#restore the database
pg_restore -Fc --host=127.0.0.1 --dbname=fusionpbx --username=fusionpbx /var/backups/fusionpbx/postgresql/fusionpbx_pgsql_$now.sql
echo "Restore Complete";
 
Status
Not open for further replies.