Ticket #2830 (closed Bugs: worksforme)

Opened 8 months ago

Last modified 1 month ago

When restore backup don't create new db entries

Reported by: casix Assigned to:
Priority: minor Milestone: 2.5
Component: Backup & Restore Version: 2.4-branch
Keywords: Cc:
Confirmation: Need Feedback SVN Revision (if applicable):
Backend Engine: All Backend Engine Version:

Description (Last modified by p_lindheimer)

I restored a backup on a new freepbx with less extensions than the older one.

At first only worked the phones that was on the old pbx.

After looking what happened I saw that freepbx on backup restore don't create de db entries:

/AMPUSER/100/cidname                              : xxxxx
/AMPUSER/100/cidnum                               : 100                      
/AMPUSER/100/device                               : 100                      
/AMPUSER/100/language                             :                          
/AMPUSER/100/noanswer                             :                          
/AMPUSER/100/outboundcid                          :                          
/AMPUSER/100/password                             :                          
/AMPUSER/100/recording                            : out=Never|in=Never       
/AMPUSER/100/ringtimer                            : 0                        
/AMPUSER/100/voicemail                            : default                 

To create it i had to go for each extension and click on submit button.

As I saw freepbx creates db entries when you click submit button and not when apply change button is clicked. When you restore a backup you must restore de db without submit each extensions.

Attachments

astdb.dump (3.2 kB) - added by casix on 05/26/08 10:01:42.
file from the backup

Change History

(follow-up: ↓ 2 ) 05/26/08 08:53:15 changed by p_lindheimer

  • priority changed from major to minor.
  • confirmation changed from Unreviewed to Need Feedback.
  • description changed.
  • milestone changed from Cut Line to 3.0.

You need to provide specific repro information. What version were you backing up from? What options selections were being backed up in the backup set. What specific steps did you take during the backup?

The backup does save all the astdb variables and they are restored if they are saved. You can open up the backup set and look at the backed up astdb variables (it's a text file) to confirm they were backed up. Your reported issue is a re-occurring situation that is occasionally reported however we can never get repro steps to reproduce it. Every time I look into it, it always works with everything getting backed up and then everything getting restored. If you can reproduce the issue consistently, we would be interested to take a look.

(in reply to: ↑ 1 ) 05/26/08 10:00:27 changed by casix

Replying to p_lindheimer:

You need to provide specific repro information. What version were you backing up from? What options selections were being backed up in the backup set. What specific steps did you take during the backup?

the version i'm backing from is a 2.3.x (I don't remeber exactly the version) that I updaded before backing it up to the newest version 2.4.0.0 because I didn't know if I can use a 2.3 backup and 2.4 restore.

After upgrade I make a backup of all sections.

I restore de backup to the new pbx. It had a prior configuration. I apply the backup in the pbx and it give me that error:

Not found The section you requested does not exist or you do not have access to it.

I click in the admin link and go to the System Status but extensions and another links was not working. The problem was that manager password was wrong (I think on restore don't update the /etc/amportal.conf then if two pbx have diferent manager password it doesn't work).

Today I have reproduced the problem with a new instalation. I tried to restore that backup and don't work. I have configured a good manager password and restore the image another time and it didn't work again. Maybe this is not the problem....

I have seen that when you restore backup de module info is not correct, or not what I espect :P

If the module was instal.led in the old pbx it is uninstalled/deactivated and version info is from old pbx. I could to be uninstalled but version number of the new pbx? or leave it installed?

I attach a astdb.dump file (I have modified it a little) where you can see that the entries are on the file but after restore the db of asterisk is identical before restore.

05/26/08 10:01:42 changed by casix

  • attachment astdb.dump added.

file from the backup

05/26/08 12:04:40 changed by p_lindheimer

the attached astdb.dump indicates that the data was saved. Can you reproduce the issue by removing parts or all of the astdb data and then doing another restore? As mentioned, none of the devs have been able to reproduce the restore process failing although we know something is lurking out there because this failure has been reported multiple times, we just can't reproduce it every time we try.

06/03/08 01:27:32 changed by casix

sorry for the delay.

I have reproduced the bug. Can you try this steps to see if you can reproduce it?

i had a machine A with freepbx 2.3.X (I don't remember the exactly version) with (if I remember good) all modules installed. I upgrade machine A to freepbx 2.4.0 and I make a complet backup of it.

Then I had machine B with a freepbx 2.4.x installed with all modules. here I show you the bin directory:

inst1:/var/lib/asterisk/bin# ls -la restore* lrwxrwxrwx 1 asterisk asterisk 76 2008-06-03 10:01 restoreastdb.php -> /var/www/inst1.adamvozip.es/htdocs/admin/modules/backup/bin/restoreastdb.php

I restore the backup and:

inst1:/var/lib/asterisk/bin# ls -la restore* lrwxrwxrwx 1 asterisk asterisk 55 2008-06-03 10:09 restoreastdb.php -> /var/www/html/admin/modules/backup/bin/restoreastdb.php

I don't remember wich modules I had in the machine A but after recovery machine B have no modules. I had to install all but install, uninstall and install make no change. restoreastdb.php allways link to a bad place.

There are others files afected in the bin directory: ampbackup.pl audio-email.pl callback dumpastdb.php fax-process.pl restoreastdb.php retrieve_backup_cron_from_mysql.pl

06/23/08 20:47:07 changed by p_lindheimer

Well we know there is an issue somewhere, but every time I try to reproduce it, similar to what you described, it works here. What Linux distribution are you running?

06/25/08 07:43:47 changed by casix

debian etch 4.0 on a xen server

08/02/08 19:56:59 changed by p_lindheimer

  • status changed from new to closed.
  • resolution set to worksforme.

this continues to work without a set of repro steps being provided that we can reproduce the issue so closing as worksforme. If someone can consistently reproduce the issue and then give us access to the backup set and the restore machine that is causing the issue to look at closer, maybe we can determine why this happens to a small percentage of people.

12/02/08 15:51:26 changed by blair.streit

I'm having the same issue with two identical machines on PBX in a Flash running FBPX 2.5.1.0. I'm running this with a Sangoma A101 using PRI. I had a single older PC (PBX0) running PiaF that I'm replacing with two new PC's (PBX1 and PBX2).

The same modules are installed on all 3 machines. If I check for online updates and check "only upgradable", the only ones that show up (as not installed) are:

FreePBX ARI Framework FreePBX FOP Framework FreePBX Localization Updates Queue Priorities Asterisk CLI DUNDi Lookup Registry

In preparation for the upgrade, all three machines were upgraded to FPBX 2.5.1.0 and made sure all installed modules were up to date. I then used the backup/restore tool on the original machine (PBX0) to create a backup with all options selected using "now" as the schedule.

For the first transition test, I copied the backup tarball to /var/lib/asterisk/backups/now on PBX1 (my primary). Note: I had to create /now because it didn't exist since the backup set wasn't created on this machine. After restoring via FBPX I then switched the cable to the Sangoma card on PBX1 and restarted asterisk and wanpipe for good measure.

As the OP stated, all calls roll to voicemail. However, I think this is a Cisco => Asterisk/SIP thing, not a FreePBX thing. If I reboot the Cisco phones calls ring through fine, so I'm considering that a separate issue that probably has nothing to to with FPBX.

However, the problem with the DB restore is consistent. When I call out caller ID shows as the default caller ID for the system instead of the personalized caller ID selected for the extension. However, if I go to the extension and hit submit, the correct caller ID is reported.

Looking at the users table in the DB, I see the expected values in the outboundcid column for ALL extensions. I can't see any difference in the DB between the ones that have been "submitted" and the ones that haven't.

This is just a hunch, but it sounds possible that a JOIN may be failing on another table that isn't populated until the "submit" button is pressed.

Anyway, to get things working smoothly again I'm going to "submit" all of my extensions (and ring groups) on PBX1. However, I'll leave PBX2 alone in case there's any comparison we could do to narrow this down. Please let me know what I can do to help....