Difference between revisions of "Upgrade"
(→Additional once only step: SQL Query) |
(→Step 1: Source) |
||
Line 20: | Line 20: | ||
#Login to the console | #Login to the console | ||
#Navigate to the fusionpbx directory | #Navigate to the fusionpbx directory | ||
− | #''It's a good idea to make a backup. If using sqlite, your backup will easily include the SQL database. Just "cp fusionpbx fusionpbx_backup" in the parent directory.'' | + | #''It's a good idea to make a backup. If using sqlite, your backup will easily include the SQL database. Just "cp -r fusionpbx fusionpbx_backup" in the parent directory.'' |
#Run: svn update | #Run: svn update | ||
Revision as of 01:51, 28 February 2011
Contents
What Is Upgrading?
The FusionPBX code is constantly evolving - bug fixes being submitted, additions to improve security, to make it look nicer, to be more flexible, and best of all - new features that are sponsored and have been implemented. A complete summary of the changes can be found on the google code page.
How to upgrade
To upgrade, you will need to get the latest source code.
Depending on how extreme the changes have been since your last update, you may need to run one-time special commands to bring your install up to date.
Step 1: Source
Upgrade the code via Subversion/SVN
- Login to the FusionPBX web interface, as a member of the superadmin group . <== note this is critical or you may not be able to do update schema afterward
- Login to the console
- Navigate to the fusionpbx directory
- It's a good idea to make a backup. If using sqlite, your backup will easily include the SQL database. Just "cp -r fusionpbx fusionpbx_backup" in the parent directory.
- Run: svn update
Step 2: Database
Many updates have changes to the database. The upgrade_schema script
- From within the web site, run Advanced -> Upgrade Schema which will add any needed newer tables or columns.
- Alternatively, simply navigate to: http://domain_or_ip/core/upgrade/upgrade_schema.php
- If your screen was nicely formatted with a fusionpbx theme, and suddenly now goes to a black and white screen with familiar text but no theme, it is because you were using a theme which no longer exists in the latest version of the code. If this happens to you navigate to:
http://domain_or_ip/mod/users/usersupdate.php
Then scroll down to where it says "Template" and select one of the valid templates from the drop down list. Then press Save. It will be fixed now and you can continue with the remaining steps below. (Note that any users who have invalid templates selected will also have the same problem you did - but you can fix them from the user manager option in the accounts menu)
Additional once only step: SQL Query
Find your version number by doing "svn info" from the console within the FusionPBX directory.
If your version is from...
- before 2011-01-04 - r669 - then you'll 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)
- results: 0 for both queries
- Log out
- Log in
- Proceed to update the menu
- before 2011-02-20 r836
"Apply settings automatically with an option to display the apply settings prompt with a variable in system -> variables -> apply_settings = true"
Step 3: Menu
Now update the menu to the latest version.
http://domain_or_ip/core/menu/menu_list.php
Press 'Restore Default' on the top right.
If 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)
- You were not logged into the browser interface
- You updated from svn via CLI
- 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...