Backup module restoration

Status
Not open for further replies.

Andrew Byrd

Member
Feb 16, 2018
309
10
18
53
Can someone tell me how to restore the "Backup" option that used to be in advanced settings? It was removed a release or two ago. I did use that and it simplified what I do.
 

Andrew Byrd

Member
Feb 16, 2018
309
10
18
53
Thank you Bryan. I didn't see anything in there that resembled the back up option being restored but I may have missed it
 

ad5ou

Active Member
Jun 12, 2018
884
197
43
The restore option was removed from the GUI.
The reasoning was most backups would be larger than what PHP could handle uploading effectively.
I believe it was also a security concern.
 

dv8inpp

Member
Jan 5, 2019
52
0
6
34
If I just want to backup one tenant so I can relocate them to another server what is the best way to do this?
 

Kenny Riley

Active Member
Nov 1, 2017
243
39
28
36
If I just want to backup one tenant so I can relocate them to another server what is the best way to do this?

I'm pretty sure this isn't possible... and if it is, it isn't going to be easy. The time you spent trying to figure out a way to do this would be better spent just recreating the call routing scheme for this tenant on your new server and updating the IP address for this customer in your carrier settings to redirect that traffic.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
It's sad that the membership thing prevents us from helping the community.

Even though I am a member, I will not use the member applications because they are closed source, I cannot see what they are doing, there is no community vulnerability vetting and if you have trouble, no one but FusionPBX will be able to support you, therefore I think it is nuts to use member applications in a production environment.

I did make a start on a domain backup script some time ago, you can see what I had pulled together here:
https://www.pbxforums.com/threads/single-domain-migration-from-server-a-to-b.3733/#post-13159

I did ask Mark for comments but did not get any feedback. I will re-visit this when I have time, it is not "rocket science" as they say! It may be that rather than using "copy (select * from..." we should create an export schema and then just create the fusion tables there with a series of "create table v_xxx as select * from..." statements.

We know most records relating to a domain have a column called domain_uuid, so we can find all the tables that contain a column with this name using the following query:

Code:
select t.table_schema,
       t.table_name
from information_schema.tables t
inner join information_schema.columns c on c.table_name = t.table_name
                                and c.table_schema = t.table_schema
where c.column_name = 'domain_uuid'
      and t.table_schema not in ('information_schema', 'pg_catalog')
      and t.table_type = 'BASE TABLE'
order by t.table_schema;


Searching with a like statement (c.column_name like '%domain_uuid%') reveals one more table - v_sip_profile_domains, where the column is called sip_profile_domain_uuid.

So we find the UUID of the domain we are interested in with:

Code:
select domain_uuid from v_domains where domain_name = 'my.comain.com'


Lets assume the domain_uuid returned is '62dce067-5d27-459f-b8e0-f0fdfce45cc6'.
Then create an export schema:
Code:
create schema myexport;

Then run some create table statements (only one shown - you get the idea):
Code:
create table myexport.v_domains as (select * from public.v_domains WHERE domain_uuid = '62dce067-5d27-459f-b8e0-f0fdfce45cc6');

This should give you a set of FusionPBX tables in the myexport schema that contain data only for the domain you are interested in. You could then export or import these using the SQL tool(s) of your choice.

PS: you will also need to copy the file system files like recordings and voicemail etc.:
Code:
... /var/lib/freeswitch/recordings/my.comain.com/*   to somewhere...
... /var/lib/freeswitch/storage/fax/my.comain.com/*  to somewhere...
... /var/lib/freeswitch/storage/voicemail/default/my.comain.com/*  to somewhere...

Hope that helps a little.
 
Status
Not open for further replies.