Difference between revisions of "Upgrade"

From FusionPBX
Jump to: navigation, search
(Source)
Line 1: Line 1:
==Source==
+
==Step 1: Source==
  
 
There are two methods to upgrade FusionPBX source.
 
There are two methods to upgrade FusionPBX source.
Line 13: Line 13:
 
   svn update
 
   svn update
  
==Database==
+
==Step 2: Database==
 
Login as a user that is a member of the super admin group.  
 
Login as a user that is a member of the super admin group.  
 
Then run Advanced -> '''[[Upgrade Schema]]''' which will ensure that your database structure is correct.
 
Then run Advanced -> '''[[Upgrade Schema]]''' which will ensure that your database structure is correct.
Line 19: Line 19:
 
   http://domain_or_ip/core/upgrade/upgrade_schema.php
 
   http://domain_or_ip/core/upgrade/upgrade_schema.php
  
==SQL Query==
+
==Additional once only step: SQL Query==
  
 
Older versions than 4th Jan 2010. Need to run the following commands from the Advanced -> SQL Query tool. These changes the group member to user. It also moves all users who are members of the 'member' group over to the 'user' group.
 
Older versions than 4th Jan 2010. Need to run the following commands from the Advanced -> SQL Query tool. These changes the group member to user. It also moves all users who are members of the 'member' group over to the 'user' group.
Line 32: Line 32:
 
*[[Upgrade#Menu|Proceed to update the menu]]
 
*[[Upgrade#Menu|Proceed to update the menu]]
  
==Menu==
+
==Step 3: Menu==
 
Now update the menu to the latest version.
 
Now update the menu to the latest version.
  
Line 39: Line 39:
 
Press 'Restore Default'
 
Press 'Restore Default'
  
==SQLite Database Restore==
+
==When things go wrong: SQLite Database Restore==
 
You shouldn't need to do this, and it's probably the wrong thing to do, but if your database won't load after an upgrade...
 
You shouldn't need to do this, and it's probably the wrong thing to do, but if your database won't load after an upgrade...
 
===Synopsis of what happened [to me]===
 
===Synopsis of what happened [to me]===

Revision as of 22:57, 18 January 2011

Step 1: Source

There are two methods to upgrade FusionPBX source.

1. Menu -> System -> Upgrade (doesn't update all files) Used to update FusionPBX to the latest release.
Note that this menu option has been removed in release 1.2 (and is expected to return in the future once it is reliable - so for now your only option is svn - see 2 below)

2. Subversion (currently the preferred method to use) Login to the FusionPBX web inteface. <== note this is critical or you may not be able to do update schema afterward

Login to the console, navigate to the fusionpbx directory:

 svn update

Step 2: Database

Login as a user that is a member of the super admin group. Then run Advanced -> Upgrade Schema which will ensure that your database structure is correct.

 http://domain_or_ip/core/upgrade/upgrade_schema.php

Additional once only step: SQL Query

Older versions than 4th Jan 2010. Need to run the following commands from the Advanced -> SQL Query tool. These changes the group member to user. It also moves all users who are members of the 'member' group over to the 'user' group.

 update v_groups set groupid = 'user', groupdesc = 'User Group' where groupid = 'member';
 update v_group_members set groupid = 'user' where groupid = 'member';

Click Execute (Type 'default', Table 'leave blank' Click Execute)

Step 3: Menu

Now update the menu to the latest version.

 http://domain_or_ip/core/menu/menu_list.php

Press 'Restore Default'

When things go wrong: SQLite Database Restore

You shouldn't need to do this, and it's probably the wrong thing to do, but if your database won't load after an upgrade...

Synopsis of what happened [to me]

You're probably seeing an error like this:

(Fatal error: Call to a member function execute() on a non-object in /var/www/fusionpbx/includes/menu.php on line 76)
  1. You were not logged into the browser interface
  2. You updated from svn via CLI
  3. You went to login to run upgrade->Schema, but couldn't due to some changes.

Remedy

from cli
mv /var/www/fusionpbx /var/www/fusionpbx.bak
reinstall the lastest fusionpbx... 
if you are using svn checkout make sure you set the permissions correctly on the fusionpbx directory structure before proceeding to the next step
from browser
login via the gui, complete the install... Don't log out
back to cli
cd /var/www/fusionpbx/secure
mv fusionpbx.db fusionpbx.db.new
cp /var/www/fusionpbx.bak/secure/fusionpbx.db ./
chown www-data:www-data fusionpbx.db
   (or whatever your webserver user/grp is)
from browser
go to: http://domain_or_ip/core/upgrade/upgrade_schema.php
This should fix the database.

You will need to have FusionPBX recreate all of the FreeSWITCH xml files. When you reinstalled, they were properly deleted (the database was empty at that point). Edit an extension/gateway/route/etc, and click save (you won't need to edit it).

In the future

Make sure you're logged into the browser interface before doing an upgrade...