Move from AsteriskNOW to FreePBX distro trashes FreePBX

I’m migrating a system from AsteriskNOW 2.0.2 (FreePBX 2.10.1.9, Asterisk 1.8.15) to FreePBX Distro 2.210.62-6 (also FreePBX 2.10.1.9, but Asterisk 1.8.20.1).

I read that I can use FreePBX Backup/Restore to back up my AsteriskNOW system and restore to the FreePBX Distro system as long as the FreePBX version numbers match. The FreePBX numbers match in these systems and yet when I do a Restore, it completely trashes FreePBX on the restored system. (If needed I can provide more detail on exactly how it trashes the restored system but I’m assuming the effect is well-known among those who have tried to backup/restore from/to different versions of FreePBX.)

I can back up AsteriskNOW 2.0.2 and restore to a different AsteriskNOW 2.0.2 installation and the restore works perfectly as best I can tell.

The big difference, of course, is that AsteriskNOW 2.0.2 is on CentOS 5.8 and FreePBX Distro 2.210.62-6 is on CentOS 6.2, but should that make that much of a difference as long as the FreePBX numbers match?

Eric / www.rkt-tech.com

It should not trash it, need to know what trash means.

Also need to know what files you backed up and restored.

What backup set did you use? Did you add any additional directories to the backup set?

I’ll send you a screen shot of what I got, in a half hour or so. (Actually, how do I do that? Can’t seem to attach files. Maybe I’ll just send you the first few lines that I see. It’s all text anyway.)

The backup set I used was the latest (early this morning) full backup of everything, from a working AsteriskNOW 2.0.2 installation. The backup archive included a /var/www/html/phpMyAdmin directory tree but I de-selected that from the restore list before starting the restore process. I had discovered earlier that a full backup backs up EVERYTHING in /var/www/html, and the restore (of any new or changed files) fails unless I change the /var/www/html directory to be owned by the asterisk user. Usually not a problem because nothing in /var/www/html changes, or didn’t until I installed phpMyAdmin.

Eric

It should not trash it, need to know what trash means.

Pointed the browser at the IP number that shows on the Linux shell screen after login, and I got the FreePBX/Schmooze opening screen. Click on PBX Administrator and I get the standard FreePBX System Status page.

Go to Admin->Backup & Restore, select Servers, and point to a download server that has the backup archives. Select Restore and highlight the latest (early this morning) backup archive.

Next page: select etc, var, PBX Settings, and CDR’s (basically, select everything), and then drill down through var and deselect /var/www/html/phpMyAdmin. Hit Restore. Restore proceeds to completion without errors or warnings.

Go back to the FreePBX / Schmooze opening screen and select PBX Administrator again. The result is basically what sort of looks like a source file with all the newlines removed, the first bit of which looks like this:

    • This program is free software, distributed under the terms of * the GNU General Public License Version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * / include (‘modules/digiumaddoninstaller/libdregister/digium_register.php’); global $db; /* * Digium Addon Installer Conf * * The conf class used by FreePBX to configure /etc/asterisk/ config files. / class digiumaddoninstaller_conf { /* * Get Filename * * No current files to be configured / public function get_filename() { return ‘’; } /* * Generate Conf * * No current files to be generated / public function generateConf($file) { return ‘’; } } /* * Digium Addons * * This class is used to manage addon information, (un)install

If you need a closer look, go to http://www.rkt-tech.com/trashed.jpg. Doesn’t look like I can upload graphics files here.

This is the same thing I got when I tried to backup from AsteriskNOW 2.0.2 and restore to AsteriskNOW 3.0.0. Restored to a different, separate installation of AsteriskNOW 2.0.2 and the restore went correctly, so it doesn’t look like a problem with the backup archive.

Eric

Notice it’s all the digium add on’s

Use the command line module_admin to remove them all. Do an amportal a r and you should be all set.

SH> Use the command line module_admin to remove them all.

OK. No idea how to do that, really, and google wasn’t a lot of help. Took a guess… fortunately this is a throwaway installation :-)… and did a “module_admin list” and then removed everything with “digium” in its name:

module_admin uninstall digium_phones
module_admin uninstall digiumaddoninstaller
amportal a r

… and no joy, still getting that same trashed display.

None of the Digium stuff is needed?

Most of the Digium stuff is redundant, it’s what is giving the errors. Do you get any errors on the amportal run?

The amportal run dumps out what looks like the entirety of the FreePBX DAHDi Config Module, followed by:

found language dir fr for directory, not installed on system, skipping
[FATAL] SELECT * FROM digium_phones_general [nativecode=1146 ** Table ‘asterisk.digium_phones_general’ doesn’t exist]

Trace Back:

/var/www/html/admin/modules/digium_phones/functions.inc.php:636 die_freepbx()
[0]: SELECT * FROM digium_phones_general [nativecode=1146 ** Table ‘asterisk.digium_phones_general’ doesn’t exist]

/var/www/html/admin/modules/digium_phones/functions.inc.php:466 digium_phones->read_general()

/var/www/html/admin/modules/digium_phones/functions.inc.php:452 digium_phones->load()

/var/www/html/admin/modules/digium_phones/functions.inc.php:70 digium_phones->digium_phones()

/var/lib/asterisk/bin/retrieve_conf:405 digium_phones_conf->digium_phones_conf()

Following the traceback to the end, I look in /var/lib/asterisk/bin/retrieve_conf and there aren’t any instances of “digium_phones_conf->digium_phones_conf()”, at line 405 or anywhere else, in fact no mention of the word “digium” anywhere in the file. Lines 404-406 are:

404 if(class_exists($classname)) {
405 ${$classname} = new $classname;
406 }

… not even anything like “$some_symbolic->$other_symbolic()” that could have been dereferenced into “digium_phones_conf->digium_phones_conf()”.

Is an old copy of /var/lib/asterisk/bin/retrieve_conf cached somewhere? An “updatedb” followed by “locate retrieve_conf” shows one copy in /var/lib/asterisk/bin and an identical copy in /usr/src/freepbx-2.10.0/amp_conf/bin.

Did you remove the DAHDI config module? It’s a conflict between the Digium one and the new one that Schmooze fixed.

Need to remove it not just disable. I would delete the module from /var/www/html/admin/modules too after doing the module_admin work if any remnants exist.

OK, well, we’re making progress. :slight_smile:

Now I get a clean FreePBX display.

Went in to Admin->Module Admin and reinstalled the (correct) DAHDi Config module. (I assume I was supposed to do that?)

Went to Reports->FreePBX System Status and got the following FreePBX Notices:

File /etc/dahdi/modules is not owned by root
File /etc/dahdi/system.conf is not owned by root
File /etc/modprobe.d/dahdi.conf is not owned by root

Clicked on each one and as advised to “Please run ‘amportal chown’”.

Sure enough, each of those is owned by the asterisk user and not by root. Checked my running AsteriskNOW installation and two of those files are also owned by the asterisk user (/etc/modprobe.d/dahdi.conf is owned by root), but FreePBX System Status on the production installation does not complain about that.

Went to the shell and ran amportal chown. Got:

SETTING FILE PERMISSIONS
chmod: cannot operate on dangling symlink '/var/lib/asterisk/bin/fax-process.pl’
Permissions OK

Went to /var/lib/asterisk/bin on the test installation and sure enough, there is a fax-process.pl symlink there that doesn’t go anywhere. That symlink does not exist on the production installation. Deleted it, and ran amportal chown again. Got:

SETTING FILE PERMISSIONS
Permissions OK

Checked those three files that FreePBX System Status was complaining about, and sure enough they are still owned by the asterisk user and FreePBX System Status is still objecting and advising me to run amportal chown.

Maybe the permissions of those files don’t matter but if so, why is FreePBX System Status flagging them as errors? Really need this to be completely clean before I can have confidence using it to replace the production installation.

Eric

Those DAHDI files need to be owned by ROOT.

Those DAHDI files need to be owned by ROOT.

All of the files in /etc/dahdi, or just the ones that FreePBX Notices is complaining about?

Any idea why amportal chown reported that permissions are OK and didn’t fix those permissions, if they’re wrong?

My production installation still has those files owned by the asterisk user and seems to be running fine with no complaints on FreePBX Notices, any idea why?

Eric

Those DAHDI files need to be owned by ROOT.

This is nuts.

Changed those files to be owned by root, then did an amportal stop followed by an amportal start. The amportal start process changed those files back to being owned by the asterisk user. It also gave me 11 instances of:

WARNING: /etc/modprobe.d/dahdi.conf line 4: ignoring bad line starting with ‘options’

Changed those files to be owned by root, again, and ran amportal chown, which changed those files back to being owned by the asterisk user.

So, bottom line, amportal chown makes those files owned by asterisk and FreePBX Notices complains about it.

WARNING: /etc/modprobe.d/dahdi.conf line 4: ignoring bad line starting with ‘options’

That line merely reads “options wctdm24xxp” without a newline at the end.

That file is auto-generated by FreePBX and we are warned against hand-editing it. Despite that, I figured maybe amportal start didn’t like the lack of a newline at the end of the line, so I hand-edited it to put one in. No difference, still get those warnings on amportal start… guess “wctdm24xxp” must be some kind of illegal option. Back to Google we go…

Well that’s a driver name. I don’t have a machine with any Dahdi hardware but I am almost sure it starts as root since it’s a Kernel module. I guess root can access any file.

The DAHDI module for FreePBX was written by Digium, then fixed and updated by Schmooze. If Digium released any modules after the Schmooze changes I don’t know either. The bottom line is you just need to blow away DAHDI and start over again.

We may never know what series of steps got you to this point. Do you by any chance have a module_admin list of the system database you reloaded?

Do you have any DAHDI hardware?

Well that’s a driver name. I don’t have a machine
with any Dahdi hardware but I am almost sure it
starts as root since it’s a Kernel module.

I don’t disagree, and yet when I set those files to be owned by root, and run amportal chown, it changes them back to be owned by the asterisk user. So someone, somewhere, at one time was convinced that asterisk is the correct owner, and wrote/configured amportal accordingly.

What strikes me as doubly odd is that FreePBX version 2.10.1.9 in AsteriskNOW is happy with those files being owned by the asterisk user, and FreePBX exact same version in the FreePBX distro is not happy with that.

The bottom line is you just need to
blow away DAHDI and start over again.

Yup, that’s what I did, and this is the result. It seems to work, but I can’t take it live without at least knowing why FreePBX is complaining about file ownerships that amportal sets.

We may never know what series of
steps got you to this point.

I dunno, I do have notes, including in this thread, and it shouldn’t be that difficult to recreate the steps starting with a fresh install of the FreePBX distro. I’ll do that if it is helpful, and post a summary report here, but won’t be able to get around to it for a couple of days.

The most basic question seems to remain, though, about why FreePBX and amportal disagree about those file ownerships in the FreePBX distro but not the AsteriskNOW distro. Very strange.

Well this is interesting enough that it is worth taking a look at your system. If you PM me your contact details I can poke around and see if it is something to bring to the developers attention.

The system that is showing this behavior isn’t visible on the net, in fact it’s a VMware VM that isn’t even running unless I want to start it up and do some stuff with it.

Over the next couple of days I’ll recreate step by step how to duplicate the issue, and we can figure out how to get the info or access to you. The organization I’m doing this for is VERY security-conscious, doesn’t understand all this techno-geeky stuff, and will no doubt object violently if I give anyone access to the system with non-public info like passwords etc. But we can figure something out.