Upgrade from 2.9.6 to 3.1.1 Problems

All about webserver configurations, PHP and databases.

Moderator: Thorsten

swalker76
Posts: 12
Joined: Thu Feb 24, 2022 6:16 pm

Upgrade from 2.9.6 to 3.1.1 Problems

Post by swalker76 »

Hi -

I am trying to upgrade our phpMyFAQ from version 2.9.6 to 3.1.1 and have encountered a problem I can't track down.

Here's what I've done so far:

(environment: CentOS 7, apache2.4.6, php 8.0.16)

1) backed up existing 2.9.6 site and database. Shut down webserver and proceeded with PHP upgrade to 8.0.16. No problems encountered there.

2) Downloaded the .gz file for 3.1.1, followed the upgrade instructions in the documentation and ran the update script. Was successful and site was working but I was unable to compile SCSS. Thorsten mentioned I needed to actually download the code via git in order to be able to compile SCSS files.

3) I followed the steps to download and install the code that are shown on the github site (https://github.com/thorsten/phpMyFAQ). Download was successful. [The database configuration is pointing at the existing v2.9.6 database]

4) Moved my previous 2.9.6 files into the new 3.1.1 folders and then ran the update script. [Database cofing shows v3.1.1 now] Everything appeared to run fine but I am unable to get to any of the Index pages. If I create an index.html page in the docroot folder I get that page to display. The page index.php does not display.

5) I turned on debugging and get this message trying to get to the main index.php page:

Uncaught exception: 'ErrorException'

Message: 'Undefined array key "sidebar"'

Stack trace:

#0 /var/www/html/phpMyFAQ/phpmyfaq/src/phpMyFAQ/Template.php(199): phpMyFAQ\Core\Error::errorHandler()
#1 /var/www/html/phpMyFAQ/phpmyfaq/index.php(709): phpMyFAQ\Template->parse()
#2 {main}
Thrown in '/var/www/html/phpMyFAQ/phpmyfaq/src/phpMyFAQ/Template.php' on line 199

6) I get this message trying to get to the admin page:

Uncaught exception: 'TypeError'

Message: 'Cannot assign null to property phpMyFAQ\Faq::$plurals of type phpMyFAQ\Language\Plurals'

Stack trace:

#0 /var/www/html/phpMyFAQ/phpmyfaq/admin/index.php(97): phpMyFAQ\Faq->__construct()
#1 {main}
Thrown in '/var/www/html/phpMyFAQ/phpmyfaq/src/phpMyFAQ/Faq.php' on line 127

Any help to figure this out is greatly appreciated!!!

Thanks -
Steve
Thorsten
Posts: 15345
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Upgrade from 2.9.6 to 3.1.1 Problems

Post by Thorsten »

Hi,

the second issue is fixed by https://github.com/thorsten/phpMyFAQ/co ... 0b4ce96570

For the first issue: do you use your v2.9 templates?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
swalker76
Posts: 12
Joined: Thu Feb 24, 2022 6:16 pm

Re: Upgrade from 2.9.6 to 3.1.1 Problems

Post by swalker76 »

Thorsten -

Thanks for the reply. I'll look into this today and let you know.

Thanks -
Steve
swalker76
Posts: 12
Joined: Thu Feb 24, 2022 6:16 pm

Re: Upgrade from 2.9.6 to 3.1.1 Problems

Post by swalker76 »

Thorsten -

It does appear that we are using the 2.9.6 templates.

The link to fix the second issue appears to have worked - I am able to see the Admin login page. I am still seeing some errors once logged in and am not seeing any of the existing data. I do see the correct categories but no data.

Steve
swalker76
Posts: 12
Joined: Thu Feb 24, 2022 6:16 pm

Re: Upgrade from 2.9.6 to 3.1.1 Problems

Post by swalker76 »

Thorsten -

After I fixed the second issue I went into the Admin interface , turned on maintenance mode and reran the update script. I am able to get to the site and see the FAQ's now. So that is resolved.

The admin interface however is not allowing me to see or edit any of the FAQ's. The dashboard is displaying an error and there are a couple of other errors as well.

Should I open a separate ticket with the issues I see in the Admin interface of just add them here?

Thanks -
Steve.
Thorsten
Posts: 15345
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Upgrade from 2.9.6 to 3.1.1 Problems

Post by Thorsten »

Hi,

please add the errors here.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
swalker76
Posts: 12
Joined: Thu Feb 24, 2022 6:16 pm

Re: Upgrade from 2.9.6 to 3.1.1 Problems

Post by swalker76 »

The dashboard error:

Uncaught exception: 'Error'

Message: 'Call to a member function fetch_row() on bool'

Stack trace:

#0 /var/www/html/phpMyFAQ/phpmyfaq/src/phpMyFAQ/Database/Mysqli.php(222): phpMyFAQ\Database\Mysqli->getOne()
#1 /var/www/html/phpMyFAQ/phpmyfaq/admin/dashboard.php(31): phpMyFAQ\Database\Mysqli->getTableStatus()
#2 /var/www/html/phpMyFAQ/phpmyfaq/admin/index.php(522): require('...')
#3 {main}

Thrown in '/var/www/html/phpMyFAQ/phpmyfaq/src/phpMyFAQ/Database/Mysqli.php' on line 294
swalker76
Posts: 12
Joined: Thu Feb 24, 2022 6:16 pm

Re: Upgrade from 2.9.6 to 3.1.1 Problems

Post by swalker76 »

Edit FAQ Error:
phpMyFAQ Fatal error

Uncaught exception: 'ErrorException'

Message: 'Undefined array key 5'

Stack trace:

#0 /var/www/html/phpMyFAQ/phpmyfaq/admin/record.show.php(410): phpMyFAQ\Core\Error::errorHandler()
#1 /var/www/html/phpMyFAQ/phpmyfaq/admin/index.php(355): require('...')
#2 {main}

Thrown in '/var/www/html/phpMyFAQ/phpmyfaq/admin/record.show.php' on line 410
Thorsten
Posts: 15345
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Upgrade from 2.9.6 to 3.1.1 Problems

Post by Thorsten »

Hi,
swalker76 wrote: Fri Mar 11, 2022 11:42 pm The dashboard error:

Uncaught exception: 'Error'

Message: 'Call to a member function fetch_row() on bool'

Stack trace:

#0 /var/www/html/phpMyFAQ/phpmyfaq/src/phpMyFAQ/Database/Mysqli.php(222): phpMyFAQ\Database\Mysqli->getOne()
#1 /var/www/html/phpMyFAQ/phpmyfaq/admin/dashboard.php(31): phpMyFAQ\Database\Mysqli->getTableStatus()
#2 /var/www/html/phpMyFAQ/phpmyfaq/admin/index.php(522): require('...')
#3 {main}

Thrown in '/var/www/html/phpMyFAQ/phpmyfaq/src/phpMyFAQ/Database/Mysqli.php' on line 294
It looks like a table is missing. How many tables do you have in your database?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15345
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Upgrade from 2.9.6 to 3.1.1 Problems

Post by Thorsten »

Hi,
swalker76 wrote: Fri Mar 11, 2022 11:44 pm Edit FAQ Error:
phpMyFAQ Fatal error

Uncaught exception: 'ErrorException'

Message: 'Undefined array key 5'

Stack trace:

#0 /var/www/html/phpMyFAQ/phpmyfaq/admin/record.show.php(410): phpMyFAQ\Core\Error::errorHandler()
#1 /var/www/html/phpMyFAQ/phpmyfaq/admin/index.php(355): require('...')
#2 {main}

Thrown in '/var/www/html/phpMyFAQ/phpmyfaq/admin/record.show.php' on line 410
I fixed this one with https://github.com/thorsten/phpMyFAQ/co ... da719bae42

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
swalker76
Posts: 12
Joined: Thu Feb 24, 2022 6:16 pm

Re: Upgrade from 2.9.6 to 3.1.1 Problems

Post by swalker76 »

Thorsten asked:
It looks like a table is missing. How many tables do you have in your database?

There are 41 tables in our FAQ DB.

Thanks -
Steve
swalker76
Posts: 12
Joined: Thu Feb 24, 2022 6:16 pm

Re: Upgrade from 2.9.6 to 3.1.1 Problems

Post by swalker76 »

swalker76 wrote: ↑Fri Mar 11, 2022 3:44 pm
Edit FAQ Error:
phpMyFAQ Fatal error

Uncaught exception: 'ErrorException'

Message: 'Undefined array key 5'

Stack trace:

#0 /var/www/html/phpMyFAQ/phpmyfaq/admin/record.show.php(410): phpMyFAQ\Core\Error::errorHandler()
#1 /var/www/html/phpMyFAQ/phpmyfaq/admin/index.php(355): require('...')
#2 {main}

Thrown in '/var/www/html/phpMyFAQ/phpmyfaq/admin/record.show.php' on line 410

I fixed this one with https://github.com/thorsten/phpMyFAQ/co ... da719bae42

bye
Thorsten

This worked perfectly - Thanks!
Thorsten
Posts: 15345
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Upgrade from 2.9.6 to 3.1.1 Problems

Post by Thorsten »

Hi,
swalker76 wrote: Mon Mar 14, 2022 3:41 pm Thorsten asked:
It looks like a table is missing. How many tables do you have in your database?

There are 41 tables in our FAQ DB.

Thanks -
Steve
a table is missing, we have 42 tables:

faqadminlog
faqattachment
faqattachment_file
faqcaptcha
faqcategories
faqcategoryrelations
faqcategory_group
faqcategory_news
faqcategory_order
faqcategory_user
faqchanges
faqcomments
faqconfig
faqdata
faqdata_group
faqdata_revisions
faqdata_tags
faqdata_user
faqglossary
faqgroup
faqgroup_right
faqinstances
faqinstances_config
faqmeta
faqnews
faqquestions
faqright
faqsearches
faqsections
faqsection_category
faqsection_group
faqsection_news
faqsessions
faqstopwords
faqtags
faquser
faquserdata
faquserlogin
faquser_group
faquser_right
faqvisits
faqvoting

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
swalker76
Posts: 12
Joined: Thu Feb 24, 2022 6:16 pm

Re: Upgrade from 2.9.6 to 3.1.1 Problems

Post by swalker76 »

Thorsten -
Sorry for the delay in reply. The missing table appears to be faqinstances_config.

This table doesn't appear in the 2.9.6 database so this must have been a problem for a while. Is there a way to rebuild and populate the table?

Thanks for all the help with this!

Steve
Thorsten
Posts: 15345
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Upgrade from 2.9.6 to 3.1.1 Problems

Post by Thorsten »

Hi Steve,

yes:

Code: Select all

START TRANSACTION;

CREATE TABLE `faqinstances_config` (
  `instance_id` int(11) NOT NULL,
  `config_name` varchar(255) NOT NULL DEFAULT '',
  `config_value` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `faqinstances_config` (`instance_id`, `config_name`, `config_value`) VALUES
(1, 'isMaster', 'true');

ALTER TABLE `faqinstances_config` ADD PRIMARY KEY (`instance_id`,`config_name`);

COMMIT;
You can run this e.g. in phpMyAdmin.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply