Upgrading OpenEMR

drbowen wrote on Monday, May 18, 2009:

Ooops!

I have just upgraded from 2.8.2-dev to 2.8.2  but I don’t remember activating the

//   $phpgacl_location = "/var/www/gacl";

I just turned on GACL per Rod’s suggestion and everything started working again.

Soooorrry…

I will proceed.

Sam Bowen

drbowen wrote on Tuesday, May 19, 2009:

During

mysql -u openemr -p openemr < 2_8_2-to-2_8_3_upgrade.sql

I get the following error message:

ERROR 1146 (42S02) at line 39: Table ‘openemr.form_football_injury_audit’ doesn’t exist

Thoughts?

Sam Bowen

drbowen wrote on Tuesday, May 19, 2009:

I just found the instruction to correct the 2_8_2-to-2_8_3_upgrade.sql to fix this.

I don’t think I need to patch the calenmdar since I am going to go immeditately to 2.9.0 and then 3.0.1.

Sam Bowen

sunsetsystems wrote on Tuesday, May 19, 2009:

You can upgrade directly to 3.0.1 from 2.8.2 or whatever.  That also allows you to use the sql_upgrade.php script which takes advantage of specially formatted comments in the *upgrade.sql files to skip parts that are inappropriate (like the one you just encountered).

Rod
www.sunsetsystems.com

bradymiller wrote on Tuesday, May 19, 2009:

Sam,
Calendar fix is just a cosmetic bug fix specific for version 2.8.3; no need to deal with it if your gonna upgrade. I’d also second Rod’s motion to take the plunge to 3.0.1 (I’d rec either doing on a separate “testing” instance of your data, or having a good backup/restore mechanism in place so you feel more comfortable).
-brady

drbowen wrote on Tuesday, May 19, 2009:

So I just move the 3.0.1 files into the web route and then execute sql_upgrade.php (from the command line)?

Sam Bowen

drbowen wrote on Tuesday, May 19, 2009:

Oh! I see it is a web page.

I’ll report back after giving it a try.

Thanks, Rod,

Sam Bowen

sunsetsystems wrote on Tuesday, May 19, 2009:

Sam, perhaps you already know this, but you also have to customize the new globals.php, sqlconf.php, etc.  In the upgrade case there is no script to do that for you like setup.php does.  And there is sl_convert.php if you are converting from sql-ledger.

Rod
www.sunsetsystems.com

drbowen wrote on Tuesday, May 19, 2009:

Does the sl_convert.php transfer billing items out of SQL Ledger?

Sam Bowen

sunsetsystems wrote on Tuesday, May 19, 2009:

Yes.  From the comments in the script:

// This may be run after an upgraded OpenEMR has been installed.
// Its purpose is to extract A/R information from SQL-Ledger and
// convert it to the OpenEMR tables that maintain A/R internally,
// thus eliminating SQL-Ledger.

Also see the file named INSTALL in the base directory of the distribution.  It has a section at the end about upgrading.

Rod
www.sunsetsystems.com

ideaman911 wrote on Wednesday, May 20, 2009:

Brady;

You mentioned that ‘Admin’ is now a hard coded “user” which cannot be removed.

Should Tony add in his instructions to DEFINITELY change the password of Admin once everything is working.  Otherwise, ANYBODY who has done an install of OpenEMR 3.0.1 will know the back-door way into any installation.  I think that is a prima facia HIPAA violation.

Just a thought.  That is certainly my advice.

One other thing on that note - my good Sister Marilyn tried to use dollar signs in her password.  It took and seemed fine, but then locked her out.  So it was good that she had the back-door.  Dollar signs are NOT acceptable in the password.

Joe Holzer    Idea Man
http://www.holzerent.com

bradymiller wrote on Wednesday, May 20, 2009:

Joe,

  To clarify my previous statement; in the admin->acl menu you just can’t remove the ‘admin’ user from the ‘administrator’ group. You’ll get a warning if you try to do it (this is a safeguard since is an easy mistake to make).  Otherwise, it’s just like any other user; you can disable ‘admin’ user in admin->users menu by unchecking that users ‘active’ toggle.

  I think Tony showed how to change password at beginning of manual.

  Tried the $ in password, and worked fine for me. That’s not to say your sister just forgot her password; possibly an encoding issue difference in IE vs Firefox. I’m actually getting passwords to work with chinese and arabic charcters on the cvs demo (that’s gotta be secure…).

-brady

drbowen wrote on Thursday, May 21, 2009:

I have created user:

admin:pass

I have changed the ownership on the following files:

chown -R apache:apache /var/www/html/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/cache
chown -R apache:apache /var/www/html/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled
chown -R apache:apache /var/www/html/openemr/edi
chown -R apache:apache /var/www/html/openemr/era
chown -R apache:apache /var/www/html/openemr/documents
chown -R apache:apache /var/www/html/openemr/custom/letter_templates
chown -R apache:apache /var/www/html/openemr/gacl/admin/templates_c
chown -R apache:apache /var/www/html/openemr/library/freeb

I have set the correct path in:

openemr/interface/globals.php

I have configured host, port, user, database in:

openemr/library/sqlconf.php
openemr/gacl/gacl.ini.php
openemr/gacl/gacl.class.php

I didn’t see anything to change in:

openemr/library/acl.inc
interface/config.php

In  gacl.class.php I wasn’t sure what to do with:

[code]
        /** @var object An ADODB database connector object */
        var $_db = ‘’; I
[/code]

I executed openemr/sql_upgrade.php  which inserted 733 SQL statements and ended without error.

I then tried to execute:

acl_setup.php

which failed giving the error message:

"Unable to create the access controls for OpenEMR.  You have likely already run this script (acl_setup.php) successfully. Other possible problems include php-GACL configuration file errors (gacl.ini.php or gacl.class.php)."

There are no gacl_tables in the openemr mysql directory.

On trying to log in with admin:pass I am get red error massages stating I had an invalid user.

(Currently, I reverted to my backup and am operating as 2.8.2.)

So, what do you guys think?

Sam Bowen

bradymiller wrote on Thursday, May 21, 2009:

Here’s a reminder of the steps for your custom upgrade:
1) Move old openemr directory to a backup directory 
2) Move new version into openemr directory 
3) Copy openemr/library/sqlconf.php file from old version into the new version 
4) Edit openemr/interface/globals.php (set $webserver_root and $web_root to be same as old version) 
5) Open up your openemr/library/sqlconf.php file and note the variables for host, login, pass, and dbase variables (I’d suggest writing these on a piece of paper in the order listed). Then place these values (with above ordering) in the corresponding blank variables found in openemr/gacl/gacl.ini.php (host, user, password, name) and openemr/gacl/gacl.class.php (db_host, db_user, db_password, db_name). Don’t touch anything else in these files.
6) Open sql_upgrade.php in browser and follow instructions (this will upgrade your sql database)
7) Open in browser openemr/gacl/setup.php (installs new embedded gacl tables)
8) Open in browser openemr/acl_setup.php (configure gacl for openemr - this script also makes admin access for the ‘admin’ user. This is why you should make an admin user before the upgrade.)
9) Configure optional settings in interface/globals.php and includes/config.php files
10) Log in as ‘admin’ and set gacl stuff for users at acl->admin

So close. Looks like you just need to do step 7. (This installs generic phpgacl, then step 8 configures for openemr), also, don’t touch the ADODB thing in gacl.class.php.

-brady

drbowen wrote on Saturday, May 30, 2009:

GOOD MORNING!

I am at it again bright and early Saturday morning on the East Coast.  This is a long post because I have included all the information in  the steps that I have taken and all the error messages that I can find.

I am trying to run #7) Open in browser openemr/gacl/setup.php (installs new embedded gacl tables)

As a reminder since this is such a long thread:

Apache 2.2.9-r1
MySQL 5.0.70-r1
PHP 5.2.8-r1
OpenEMR 2.8.2 upgrading to 3.0.1

I have trying Rod’s and Brady’s advice and jumping from 2.8.2 to 3.0.1.

I backed up everything.

I have created admin:pass  (and tested it repeatedly)

I moved everything over to a backup server and have disabled / deleted the old phpGACL installation since it had a lot of errors.  I removed the httpd.conf include statement to the old gacl installation.  I dropped the original gacl database from the mysql.

I moved openemr to openemr-2.8.2 and moved openemr-3.0.1 to openemr.  I made all the permission changes and changes to globals.php. sqlconf.php, config.php, openemr/gacl/gacl.ini.php, and openemr/gacl/gacl.class.php. 

I have already previously executed sql_upgrade.php which inserted 733 sql statements and terminated normally.

In php.ini I have the following:

[code]
error_reporting  =  E_ALL & ~E_NOTICE
display_errors = On
display_startup_errors = Off
log_errors = On
error_log = /var/log/php.err
[/code]

The following error message states:  "(set it to TRUE in $gacl_options near top of admin/gacl_admin.inc.php)"

The only debug variable I can find is in openemr/gacl/gacl.class.php
I set:
var $_debug = TRUE;

I gracefully restarted apache.
I cleared my private data in firefox, cleared the cache and then restarted firefox "for good luck."

When I try to log in I get the following:

There are a couple of unusually long pauses but the login page does come up.

[output]
get_object_id(): Section Value: users Value: admin Object Type: aro

(mysql): SELECT id FROM gacl_aro WHERE section_value=‘users’ AND value=‘admin’  

get_object_id(): Returned 0 rows

Warning: Cannot modify header information - headers already sent by (output started at /var/www/localhost/htdocs/openemr/gacl/gacl.class.php:186) in /var/www/localhost/htdocs/openemr/library/auth.inc on line 148
[/output]

This is not unexpected since I have not installed the new gacl.

When I run:
openemr/gacl/setup.php

I get:
[output]
Option: debug
Valid Config options: debug
Configuration:
driver = mysql,
host = localhost,
user = openemr,
database = openemr,
table prefix = gacl_Testing database connection…
Success! Connected to "mysql" database on "localhost".
Testing database type…
Success! Compatible database type "mysql" detected!
Making sure database "openemr" exists…
Success! Good, database "openemr" already exists!
Failed! Failed creating tables. Please enable DEBUG mode (set it to TRUE in $gacl_options near top of admin/gacl_admin.inc.php) to see the error and try again. You will most likely need to delete any tables already created.
Failed! Please fix the above errors and try again.
[/output]

Some of the tables are created:
gacl_acl
gacl_acl_sections
gacl_aco
gacl_aco_sections
gacl_aro
gacl_aro_groups
gacl_aro_groups_map
gacl_aro_sections
gacl_axo
gacl_axo_groups
gacl_axo_groups_map
gacl_axo_sections
gacl_groups_aro_map
gacl_groups_axo_map
gacl_phpgacl

But to me some of them seem to missing:

gacl_acl_seq
gacl_aco_map
gacl_aco_sections_seq
gacl_aco_seq
gacl_aro_groups_id_seq
gacl_aro_sections_seq
gacl_aro_seq
gacl_axo_map

For error messages I get the following:
tail /var/log/php.err
tail /var/log/mysql/mysqld.err
are both empty.

tail /var/log/apache2/error_log:

[Sat May 30 11:09:55 2009] [error] [client 192.168.100.53] File does not exist: /var/www/localhost/htdocs/pics, referer: http://leia/

[Sat May 30 11:10:24 2009] [error] [client 192.168.100.53] PHP Warning:  Cannot modify header information - headers already sent by (output started at /var/www/localhost/htdocs/openemr/gacl/gacl.class.php:186) in /var/www/localhost/htdocs/openemr/library/auth.inc on line 148, referer: http://leia/openemr/interface/login/login.php

tail /var/log/php.err
tail /var/log/mysql/mysqld.err
are both empty.

So I am back to I need some help and I hope you guys have some ideas about where to proceed from here.

Sam Bowen, MD

drbowen wrote on Saturday, May 30, 2009:

From the gacl/setup.php there is a comment:

// Execute the SQL on the database
#ADODB’s xmlschema is being lame, continue on error.
$schema->ContinueOnError(TRUE);
$result = $schema->ExecuteSchema();

I guess it is possible that this is not a real error?

Sam Bowen, MD

bradymiller wrote on Sunday, May 31, 2009:

hey,

First,
Try setting the debug flag in openemr/gacl/gacl.ini.php to true (put the other one back to false). This will then produce a huge amount of useful output during gacl install.

Second,
Kind of wondering if this is going to be the issue, but will wait for the error log (ensure your mysql isn’t defaulted to creating utf-8 databases):
https://sourceforge.net/forum/forum.php?thread_id=3068329&forum_id=202504

Third (unrelated to your problem):
Make display_errors = Off in your php.ini. If on, can break ajax stuff in openemr.
(I’ve actually placed a list of rec. php settings in the oemr.org FAQ)

-brady

bo2999 wrote on Sunday, May 31, 2009:

Hi,

<openemr>/gacl/gacl.class.php never seems to work for me.  I always see the complaints "Failed! Failed creating tables."

You may try

1) delete all gacl_ tables
2) run <openemr>/acl_setup.php

Just a thought.!

Bo

drbowen wrote on Sunday, May 31, 2009:

I just tried an end around run.

I created a new installation of openemr-3.0.1 from scratch.

I stopped the mysql engine.

I moved the new mysql to mysql-3.0.1-new-installation

I swapped the old /var/lib/mysql-2.8.2 into

/var/lib/mysql/

I copied mysql-3.0.1-new-installation/openemr/gacl*  to /var/lib/mysql/openemr/

I then restarted the mysql engine.

I can now log in as admin:pass and my patient data seems to be there.  I tried a few queries and found the patients etc.

Unfortunately my new admin is being treated as a unprivileged user.

So, will it be easier to "break in" and restore the privileges of "admin" to the administrative user.  Or proceed with the attempt at upgrading the old 2.8.2 to 3.0.1 using the debugging?

Sam Bowen, MD

drbowen wrote on Sunday, May 31, 2009:

OK I went back to the original version openemr-2.8.2 database of mysql.  I had changed the php.ini flags as recommended in the openemr/setup.php.

executing openemr/acl_setup.php  gave an error message that I had already set up the database.

executing openemr/gacl/setup.php gave the following output on the screen:

Option: db_type
Valid Config options: db_type
Option: db_host
Valid Config options: db_host
Option: db_user
Valid Config options: db_user
Option: db_password
Valid Config options: db_password
Option: db_name
Valid Config options: db_name
Option: db_table_prefix
Valid Config options: db_table_prefix
Option: caching
Valid Config options: caching
Option: force_cache_expire
Valid Config options: force_cache_expire
Option: cache_dir
Valid Config options: cache_dir
Option: cache_expire_time
Valid Config options: cache_expire_time
Option: items_per_page
Valid Config options: items_per_page
Option: max_select_box_items
Valid Config options: max_select_box_items
Option: max_search_return_items
Valid Config options: max_search_return_items
Option: smarty_dir
ERROR: Config option: smarty_dir is not a valid option
Option: smarty_template_dir
ERROR: Config option: smarty_template_dir is not a valid option
Option: smarty_compile_dir
ERROR: Config option: smarty_compile_dir is not a valid option
Configuration:
driver = mysql,
host = localhost,
user = openemr,
database = openemr,
table prefix = gacl_Testing database connection…
Success! Connected to “mysql” database on “localhost”.
Testing database type…
Success! Compatible database type “mysql” detected!
Making sure database “openemr” exists…
(mysql): show databases   Success! Good, database “openemr” already exists!
(mysql): select version()   (mysql): SHOW INDEX FROM gacl_phpgacl   1146: Table ‘openemr.gacl_phpgacl’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_phpgacl`   1146: Table ‘openemr.gacl_phpgacl’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_acl   1146: Table ‘openemr.gacl_acl’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_acl`   1146: Table ‘openemr.gacl_acl’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_acl_sections   1146: Table ‘openemr.gacl_acl_sections’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_acl_sections`   1146: Table ‘openemr.gacl_acl_sections’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_aco   1146: Table ‘openemr.gacl_aco’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_aco`   1146: Table ‘openemr.gacl_aco’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_aco_map   1146: Table ‘openemr.gacl_aco_map’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_aco_map`   1146: Table ‘openemr.gacl_aco_map’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_aco_sections   1146: Table ‘openemr.gacl_aco_sections’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_aco_sections`   1146: Table ‘openemr.gacl_aco_sections’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_aro   1146: Table ‘openemr.gacl_aro’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_aro`   1146: Table ‘openemr.gacl_aro’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_aro_map   1146: Table ‘openemr.gacl_aro_map’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_aro_map`   1146: Table ‘openemr.gacl_aro_map’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_aro_sections   1146: Table ‘openemr.gacl_aro_sections’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_aro_sections`   1146: Table ‘openemr.gacl_aro_sections’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_axo   1146: Table ‘openemr.gacl_axo’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_axo`   1146: Table ‘openemr.gacl_axo’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_axo_map   1146: Table ‘openemr.gacl_axo_map’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_axo_map`   1146: Table ‘openemr.gacl_axo_map’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_axo_sections   1146: Table ‘openemr.gacl_axo_sections’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_axo_sections`   1146: Table ‘openemr.gacl_axo_sections’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_aro_groups   1146: Table ‘openemr.gacl_aro_groups’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_aro_groups`   1146: Table ‘openemr.gacl_aro_groups’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_groups_aro_map   1146: Table ‘openemr.gacl_groups_aro_map’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_groups_aro_map`   1146: Table ‘openemr.gacl_groups_aro_map’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_aro_groups_map   1146: Table ‘openemr.gacl_aro_groups_map’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_aro_groups_map`   1146: Table ‘openemr.gacl_aro_groups_map’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_axo_groups   1146: Table ‘openemr.gacl_axo_groups’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_axo_groups`   1146: Table ‘openemr.gacl_axo_groups’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_groups_axo_map   1146: Table ‘openemr.gacl_groups_axo_map’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_groups_axo_map`   1146: Table ‘openemr.gacl_groups_axo_map’ doesn’t exist
(mysql): SHOW INDEX FROM gacl_axo_groups_map   1146: Table ‘openemr.gacl_axo_groups_map’ doesn’t exist
(mysql): SHOW COLUMNS FROM `gacl_axo_groups_map`   1146: Table ‘openemr.gacl_axo_groups_map’ doesn’t exist
Here’s the SQL to do the build:
CREATE TABLE gacl_phpgacl (
name VARCHAR(230) NOT NULL,
value VARCHAR(230) NOT NULL,
PRIMARY KEY (name)
);

DELETE FROM gacl_phpgacl WHERE name=‘version’;

INSERT INTO gacl_phpgacl (name,value) VALUES (‘version’,‘3.3.7’);

DELETE FROM gacl_phpgacl WHERE name=‘schema_version’;

INSERT INTO gacl_phpgacl (name,value) VALUES (‘schema_version’,‘2.1’);

CREATE TABLE gacl_acl (
id INTEGER NOT NULL DEFAULT 0,
section_value VARCHAR(230) NOT NULL DEFAULT ‘system’,
allow INTEGER NOT NULL DEFAULT 0,
enabled INTEGER NOT NULL DEFAULT 0,
return_value TEXT,
note TEXT,
updated_date INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (id)
);

ALTER TABLE gacl_acl ADD INDEX gacl_enabled_acl (enabled);

ALTER TABLE gacl_acl ADD INDEX gacl_section_value_acl (section_value);

ALTER TABLE gacl_acl ADD INDEX gacl_updated_date_acl (updated_date);

CREATE TABLE gacl_acl_sections (
id INTEGER NOT NULL DEFAULT 0,
value VARCHAR(230) NOT NULL,
order_value INTEGER NOT NULL DEFAULT 0,
name VARCHAR(230) NOT NULL,
hidden INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (id)
);

ALTER TABLE gacl_acl_sections ADD UNIQUE INDEX gacl_value_acl_sections (value);

ALTER TABLE gacl_acl_sections ADD INDEX gacl_hidden_acl_sections (hidden);

DELETE FROM gacl_acl_sections WHERE id=1 AND value=‘system’;

INSERT INTO gacl_acl_sections (id,value,order_value,name) VALUES (1,‘system’,1,‘System’);

DELETE FROM gacl_acl_sections WHERE id=2 AND value=‘user’;

INSERT INTO gacl_acl_sections (id,value,order_value,name) VALUES (2,‘user’,2,‘User’);

CREATE TABLE gacl_aco (
id INTEGER NOT NULL DEFAULT 0,
section_value VARCHAR(240) NOT NULL DEFAULT ‘0’,
value VARCHAR(240) NOT NULL,
order_value INTEGER NOT NULL DEFAULT 0,
name VARCHAR(255) NOT NULL,
hidden INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (id)
);

ALTER TABLE gacl_aco ADD UNIQUE INDEX gacl_section_value_value_aco (section_value, value);

ALTER TABLE gacl_aco ADD INDEX gacl_hidden_aco (hidden);

CREATE TABLE gacl_aco_map (
acl_id INTEGER NOT NULL DEFAULT 0,
section_value VARCHAR(230) NOT NULL DEFAULT ‘0’,
value VARCHAR(230) NOT NULL,
PRIMARY KEY (acl_id, section_value, value)
);

CREATE TABLE gacl_aco_sections (
id INTEGER NOT NULL DEFAULT 0,
value VARCHAR(230) NOT NULL,
order_value INTEGER NOT NULL DEFAULT 0,
name VARCHAR(230) NOT NULL,
hidden INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (id)
);

ALTER TABLE gacl_aco_sections ADD UNIQUE INDEX gacl_value_aco_sections (value);

ALTER TABLE gacl_aco_sections ADD INDEX gacl_hidden_aco_sections (hidden);

CREATE TABLE gacl_aro (
id INTEGER NOT NULL DEFAULT 0,
section_value VARCHAR(240) NOT NULL DEFAULT ‘0’,
value VARCHAR(240) NOT NULL,
order_value INTEGER NOT NULL DEFAULT 0,
name VARCHAR(255) NOT NULL,
hidden INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (id)
);

ALTER TABLE gacl_aro ADD UNIQUE INDEX gacl_section_value_value_aro (section_value, value);

ALTER TABLE gacl_aro ADD INDEX gacl_hidden_aro (hidden);

CREATE TABLE gacl_aro_map (
acl_id INTEGER NOT NULL DEFAULT 0,
section_value VARCHAR(230) NOT NULL DEFAULT ‘0’,
value VARCHAR(230) NOT NULL,
PRIMARY KEY (acl_id, section_value, value)
);

CREATE TABLE gacl_aro_sections (
id INTEGER NOT NULL DEFAULT 0,
value VARCHAR(230) NOT NULL,
order_value INTEGER NOT NULL DEFAULT 0,
name VARCHAR(230) NOT NULL,
hidden INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (id)
);

ALTER TABLE gacl_aro_sections ADD UNIQUE INDEX gacl_value_aro_sections (value);

ALTER TABLE gacl_aro_sections ADD INDEX gacl_hidden_aro_sections (hidden);

CREATE TABLE gacl_axo (
id INTEGER NOT NULL DEFAULT 0,
section_value VARCHAR(240) NOT NULL DEFAULT ‘0’,
value VARCHAR(240) NOT NULL,
order_value INTEGER NOT NULL DEFAULT 0,
name VARCHAR(255) NOT NULL,
hidden INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (id)
);

ALTER TABLE gacl_axo ADD UNIQUE INDEX gacl_section_value_value_axo (section_value, value);

ALTER TABLE gacl_axo ADD INDEX gacl_hidden_axo (hidden);

CREATE TABLE gacl_axo_map (
acl_id INTEGER NOT NULL DEFAULT 0,
section_value VARCHAR(230) NOT NULL DEFAULT ‘0’,
value VARCHAR(230) NOT NULL,
PRIMARY KEY (acl_id, section_value, value)
);

CREATE TABLE gacl_axo_sections (
id INTEGER NOT NULL DEFAULT 0,
value VARCHAR(230) NOT NULL,
order_value INTEGER NOT NULL DEFAULT 0,
name VARCHAR(230) NOT NULL,
hidden INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (id)
);

ALTER TABLE gacl_axo_sections ADD UNIQUE INDEX gacl_value_axo_sections (value);

ALTER TABLE gacl_axo_sections ADD INDEX gacl_hidden_axo_sections (hidden);

CREATE TABLE gacl_aro_groups (
id INTEGER NOT NULL DEFAULT 0,
parent_id INTEGER NOT NULL DEFAULT 0,
lft INTEGER NOT NULL DEFAULT 0,
rgt INTEGER NOT NULL DEFAULT 0,
name VARCHAR(255) NOT NULL,
value VARCHAR(255) NOT NULL,
PRIMARY KEY (id, value)
);

ALTER TABLE gacl_aro_groups ADD INDEX gacl_parent_id_aro_groups (parent_id);

ALTER TABLE gacl_aro_groups ADD UNIQUE INDEX gacl_value_aro_groups (value);

ALTER TABLE gacl_aro_groups ADD INDEX gacl_lft_rgt_aro_groups (lft, rgt);

CREATE TABLE gacl_groups_aro_map (
group_id INTEGER NOT NULL DEFAULT 0,
aro_id INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (group_id, aro_id)
);

ALTER TABLE gacl_groups_aro_map ADD INDEX gacl_aro_id (aro_id);

CREATE TABLE gacl_aro_groups_map (
acl_id INTEGER NOT NULL DEFAULT 0,
group_id INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (acl_id, group_id)
);

CREATE TABLE gacl_axo_groups (
id INTEGER NOT NULL DEFAULT 0,
parent_id INTEGER NOT NULL DEFAULT 0,
lft INTEGER NOT NULL DEFAULT 0,
rgt INTEGER NOT NULL DEFAULT 0,
name VARCHAR(255) NOT NULL,
value VARCHAR(255) NOT NULL,
PRIMARY KEY (id, value)
);

ALTER TABLE gacl_axo_groups ADD INDEX gacl_parent_id_axo_groups (parent_id);

ALTER TABLE gacl_axo_groups ADD UNIQUE INDEX gacl_value_axo_groups (value);

ALTER TABLE gacl_axo_groups ADD INDEX gacl_lft_rgt_axo_groups (lft, rgt);

CREATE TABLE gacl_groups_axo_map (
group_id INTEGER NOT NULL DEFAULT 0,
axo_id INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (group_id, axo_id)
);

ALTER TABLE gacl_groups_axo_map ADD INDEX gacl_axo_id (axo_id);

CREATE TABLE gacl_axo_groups_map (
acl_id INTEGER NOT NULL DEFAULT 0,
group_id INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (acl_id, group_id)
); (mysql): CREATE TABLE gacl_phpgacl ( name VARCHAR(230) NOT NULL, value VARCHAR(230) NOT NULL, PRIMARY KEY (name) )   (mysql): DELETE FROM gacl_phpgacl WHERE name=‘version’   (mysql): INSERT INTO gacl_phpgacl (name,value) VALUES (‘version’,‘3.3.7’)   (mysql): DELETE FROM gacl_phpgacl WHERE name=‘schema_version’   (mysql): INSERT INTO gacl_phpgacl (name,value) VALUES (‘schema_version’,‘2.1’)   (mysql): CREATE TABLE gacl_acl ( id INTEGER NOT NULL DEFAULT 0, section_value VARCHAR(230) NOT NULL DEFAULT ‘system’, allow INTEGER NOT NULL DEFAULT 0, enabled INTEGER NOT NULL DEFAULT 0, return_value TEXT, note TEXT, updated_date INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (id) )   (mysql): ALTER TABLE gacl_acl ADD INDEX gacl_enabled_acl (enabled)   (mysql): ALTER TABLE gacl_acl ADD INDEX gacl_section_value_acl (section_value)   (mysql): ALTER TABLE gacl_acl ADD INDEX gacl_updated_date_acl (updated_date)   (mysql): CREATE TABLE gacl_acl_sections ( id INTEGER NOT NULL DEFAULT 0, value VARCHAR(230) NOT NULL, order_value INTEGER NOT NULL DEFAULT 0, name VARCHAR(230) NOT NULL, hidden INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (id) )   (mysql): ALTER TABLE gacl_acl_sections ADD UNIQUE INDEX gacl_value_acl_sections (value)   (mysql): ALTER TABLE gacl_acl_sections ADD INDEX gacl_hidden_acl_sections (hidden)   (mysql): DELETE FROM gacl_acl_sections WHERE id=1 AND value=‘system’   (mysql): INSERT INTO gacl_acl_sections (id,value,order_value,name) VALUES (1,‘system’,1,‘System’)   (mysql): DELETE FROM gacl_acl_sections WHERE id=2 AND value=‘user’   (mysql): INSERT INTO gacl_acl_sections (id,value,order_value,name) VALUES (2,‘user’,2,‘User’)   (mysql): CREATE TABLE gacl_aco ( id INTEGER NOT NULL DEFAULT 0, section_value VARCHAR(240) NOT NULL DEFAULT ‘0’, value VARCHAR(240) NOT NULL, order_value INTEGER NOT NULL DEFAULT 0, name VARCHAR(255) NOT NULL, hidden INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (id) )   (mysql): ALTER TABLE gacl_aco ADD UNIQUE INDEX gacl_section_value_value_aco (section_value, value)   1071: Specified key was too long; max key length is 1000 bytes
(mysql): ALTER TABLE gacl_aco ADD INDEX gacl_hidden_aco (hidden)   (mysql): CREATE TABLE gacl_aco_map ( acl_id INTEGER NOT NULL DEFAULT 0, section_value VARCHAR(230) NOT NULL DEFAULT ‘0’, value VARCHAR(230) NOT NULL, PRIMARY KEY (acl_id, section_value, value) )   1071: Specified key was too long; max key length is 1000 bytes
(mysql): CREATE TABLE gacl_aco_sections ( id INTEGER NOT NULL DEFAULT 0, value VARCHAR(230) NOT NULL, order_value INTEGER NOT NULL DEFAULT 0, name VARCHAR(230) NOT NULL, hidden INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (id) )   (mysql): ALTER TABLE gacl_aco_sections ADD UNIQUE INDEX gacl_value_aco_sections (value)   (mysql): ALTER TABLE gacl_aco_sections ADD INDEX gacl_hidden_aco_sections (hidden)   (mysql): CREATE TABLE gacl_aro ( id INTEGER NOT NULL DEFAULT 0, section_value VARCHAR(240) NOT NULL DEFAULT ‘0’, value VARCHAR(240) NOT NULL, order_value INTEGER NOT NULL DEFAULT 0, name VARCHAR(255) NOT NULL, hidden INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (id) )   (mysql): ALTER TABLE gacl_aro ADD UNIQUE INDEX gacl_section_value_value_aro (section_value, value)   1071: Specified key was too long; max key length is 1000 bytes
(mysql): ALTER TABLE gacl_aro ADD INDEX gacl_hidden_aro (hidden)   (mysql): CREATE TABLE gacl_aro_map ( acl_id INTEGER NOT NULL DEFAULT 0, section_value VARCHAR(230) NOT NULL DEFAULT ‘0’, value VARCHAR(230) NOT NULL, PRIMARY KEY (acl_id, section_value, value) )   1071: Specified key was too long; max key length is 1000 bytes
(mysql): CREATE TABLE gacl_aro_sections ( id INTEGER NOT NULL DEFAULT 0, value VARCHAR(230) NOT NULL, order_value INTEGER NOT NULL DEFAULT 0, name VARCHAR(230) NOT NULL, hidden INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (id) )   (mysql): ALTER TABLE gacl_aro_sections ADD UNIQUE INDEX gacl_value_aro_sections (value)   (mysql): ALTER TABLE gacl_aro_sections ADD INDEX gacl_hidden_aro_sections (hidden)   (mysql): CREATE TABLE gacl_axo ( id INTEGER NOT NULL DEFAULT 0, section_value VARCHAR(240) NOT NULL DEFAULT ‘0’, value VARCHAR(240) NOT NULL, order_value INTEGER NOT NULL DEFAULT 0, name VARCHAR(255) NOT NULL, hidden INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (id) )   (mysql): ALTER TABLE gacl_axo ADD UNIQUE INDEX gacl_section_value_value_axo (section_value, value)   1071: Specified key was too long; max key length is 1000 bytes
(mysql): ALTER TABLE gacl_axo ADD INDEX gacl_hidden_axo (hidden)   (mysql): CREATE TABLE gacl_axo_map ( acl_id INTEGER NOT NULL DEFAULT 0, section_value VARCHAR(230) NOT NULL DEFAULT ‘0’, value VARCHAR(230) NOT NULL, PRIMARY KEY (acl_id, section_value, value) )   1071: Specified key was too long; max key length is 1000 bytes
(mysql): CREATE TABLE gacl_axo_sections ( id INTEGER NOT NULL DEFAULT 0, value VARCHAR(230) NOT NULL, order_value INTEGER NOT NULL DEFAULT 0, name VARCHAR(230) NOT NULL, hidden INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (id) )   (mysql): ALTER TABLE gacl_axo_sections ADD UNIQUE INDEX gacl_value_axo_sections (value)   (mysql): ALTER TABLE gacl_axo_sections ADD INDEX gacl_hidden_axo_sections (hidden)   (mysql): CREATE TABLE gacl_aro_groups ( id INTEGER NOT NULL DEFAULT 0, parent_id INTEGER NOT NULL DEFAULT 0, lft INTEGER NOT NULL DEFAULT 0, rgt INTEGER NOT NULL DEFAULT 0, name VARCHAR(255) NOT NULL, value VARCHAR(255) NOT NULL, PRIMARY KEY (id, value) )   (mysql): ALTER TABLE gacl_aro_groups ADD INDEX gacl_parent_id_aro_groups (parent_id)   (mysql): ALTER TABLE gacl_aro_groups ADD UNIQUE INDEX gacl_value_aro_groups (value)   (mysql): ALTER TABLE gacl_aro_groups ADD INDEX gacl_lft_rgt_aro_groups (lft, rgt)   (mysql): CREATE TABLE gacl_groups_aro_map ( group_id INTEGER NOT NULL DEFAULT 0, aro_id INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (group_id, aro_id) )  

(mysql): ALTER TABLE gacl_groups_aro_map ADD INDEX gacl_aro_id (aro_id)  

(mysql): CREATE TABLE gacl_aro_groups_map ( acl_id INTEGER NOT NULL DEFAULT 0, group_id INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (acl_id, group_id) )  

(mysql): CREATE TABLE gacl_axo_groups ( id INTEGER NOT NULL DEFAULT 0, parent_id INTEGER NOT NULL DEFAULT 0, lft INTEGER NOT NULL DEFAULT 0, rgt INTEGER NOT NULL DEFAULT 0, name VARCHAR(255) NOT NULL, value VARCHAR(255) NOT NULL, PRIMARY KEY (id, value) )  

(mysql): ALTER TABLE gacl_axo_groups ADD INDEX gacl_parent_id_axo_groups (parent_id)  

(mysql): ALTER TABLE gacl_axo_groups ADD UNIQUE INDEX gacl_value_axo_groups (value)   (mysql): ALTER TABLE gacl_axo_groups ADD INDEX gacl_lft_rgt_axo_groups (lft, rgt)  

(mysql): CREATE TABLE gacl_groups_axo_map ( group_id INTEGER NOT NULL DEFAULT 0, axo_id INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (group_id, axo_id) )   \

(mysql): ALTER TABLE gacl_groups_axo_map ADD INDEX gacl_axo_id (axo_id)   (mysql): CREATE TABLE gacl_axo_groups_map ( acl_id INTEGER NOT NULL DEFAULT 0, group_id INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (acl_id, group_id) )  

Failed! Failed creating tables. Please enable DEBUG mode (set it to TRUE in $gacl_options near top of admin/gacl_admin.inc.php) to see the error and try again. You will most likely need to delete any tables already created.
Failed! Please fix the above errors and try again.

I will check the error logs and post those shortly.

Sam Bowen, MD