Subject: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 06/02/2014 05:57pm
By: Habitual

I've managed to get to 1.8.2sr1 without an issue from 1.8.1
However, trying to get from 1.8.2sr1 to 2.0.0 has been difficult.

I exported my 1.8.1 data to data181.sql and ran the "migrate" option since I'm testing the process on a new server.
This got me to 1.8.2sr1.

I exported my 1.8.2sr1 data to data182.sql and proceeded several times now to attempt the 2.0.0 install. After choosing to migrate the data182.sql, I get only a blank page after the migrate option starts|attempts its function.

I enabled $_CONF['rootdebug'] = true;
and have this message:
PHP Formatted Code
If this is a production website you must disable this option once you have resolved any issues you are investigating.

256 - 1054: Unknown column 'whos_online' in 'field list' @ /var/www/system/databases/mysqli.class.php line 279
Call Stack
#       Function        File    Line
1       trigger_error   /var/www/system/databases/mysqli.class.php      279
2       dbQuery /var/www/system/lib-database.php        213
3       DB_query        /var/www/system/lib-sessions.php        486
4       SESS_updateSessionTime  /var/www/system/lib-sessions.php        114
5       SESS_sessionCheck       /var/www/system/lib-sessions.php        66
6       require_once    /var/www/html/lib-common.php    274
7       require_once    /var/www/html/index.php 35

array(3) {
  ["sql"]=>
  string(120) "UPDATE gl_sessions SET start_time = 1391725984, whos_online = 1 WHERE (md5_sess_id = '3eab377cf7754a72fd58153b26248c36')"
  ["ignore_errors"]=>
  int(0)
  ["result"]=>
  bool(false)
}


Which if odd since I don't even use the "who's online" feature/block on my 1.8.1 site.

I deleted the block from my data182 "site" and re-exported the db to data182.sql and tried the upgrade to 2.0.0 again with the same result.

cache is cleared.
What should I do to fix this?

Thanks!

Edit: I deleted the who's online block from my 1.8.2sr1 site and tried migrate again, no likey.

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 06/02/2014 07:33pm
By: Laugh

It looks like your gl_session table did not get updated properly. Do you know how to use phpmyadmin to access your database? If so make sure your gl_sessions table has the following columns:

sess_id
start_time
remote_ip
uid
md5_sess_id
whos_online
topic

The whos_online column is needed even if you do not have the block.

If this table did not get updated there may be others....

Also what plugins do you have installed as some of the non-core ones are incompatible with Geeklog 2.0.0?

Tom

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 07/02/2014 09:07am
By: Habitual

Tom:
I am a c-line kinda of guy, but that field is missing from the table:
PHP Formatted Code
+-------------+------------------+------+-----+---------+-------+
| Field       | Type             | Null | Key | Default | Extra |
+-------------+------------------+------+-----+---------+-------+
| sess_id     | int(10) unsigned | NO   | PRI | 0       |       |
| start_time  | int(10) unsigned | NO   | MUL | 0       |       |
| remote_ip   | varchar(39)      | NO   | MUL |         |       |
| uid         | mediumint(8)     | NO   |     | 1       |       |
| md5_sess_id | varchar(128)     | YES  |     | NULL    |       |
+-------------+------------------+------+-----+---------+-------+


Fields whos_online and topic are missing from the original site's db also.
Suggestions appreciated.

Thank you.

Edit: 1.8.1 plugins shown here...

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 07/02/2014 03:13pm
By: Habitual

Update: logs/error.log shows only this recent activity on the originating site:
PHP Formatted Code
Wed Feb  5 13:39:55 2014 - 108.162.219.50 - 1054: Unknown column 'whos_online' in 'field list' in /home/content/09/9302509/system/lib-sessions.php:486. SQL in question: UPDATE gl_sessions SET start_time = 1391625595, whos_online = 1 WHERE (md5_sess_id = '01007928c4761859d40a65a673bed575')
Wed Feb  5 13:39:59 2014 - 108.162.219.50 - 1054: Unknown column 'whos_online' in 'field list' in /home/content/09/9302509/system/lib-sessions.php:486. SQL in question: UPDATE gl_sessions SET start_time = 1391625599, whos_online = 1 WHERE (md5_sess_id = '01007928c4761859d40a65a673bed575')
Wed Feb  5 14:13:48 2014 - 108.162.219.50 - 1054: Unknown column 'whos_online' in 'field list' in /home/content/09/9302509/system/lib-sessions.php:362. SQL in question: INSERT INTO gl_sessions (sess_id, md5_sess_id, uid, start_time, remote_ip, whos_online) VALUES (896629745, '2129977c1ce7b08adac5a4239cd243bf', 1, 1391627628, '108.162.219.50', 1)
Wed Feb  5 14:13:49 2014 - 108.162.219.50 - 1054: Unknown column 'whos_online' in 'field list' in /home/content/09/9302509/system/lib-sessions.php:362. SQL in question: INSERT INTO gl_sessions (sess_id, md5_sess_id, uid, start_time, remote_ip, whos_online) VALUES (672204130, 'e323efeccbaa6302d1b0136dc3c1e832', 1, 1391627629, '108.162.219.50', 1)
Wed Feb  5 14:18:51 2014 - 108.162.219.50 - 1054: Unknown column 'whos_online' in 'field list' in /home/content/09/9302509/system/lib-sessions.php:362. SQL in question: INSERT INTO gl_sessions (sess_id, md5_sess_id, uid, start_time, remote_ip, whos_online) VALUES (1757656990, '1e48bc48d4bb6707c4fed756e893f79d', 1, 1391627931, '108.162.219.50', 1)


It only "started" 2 days ago?

2 archived files both have the insert into statements in the .sql
however both are missing those 2 fields as well in those same .sql files.

It's getting Deep!
I went back 2 years to the file I used to create the "current" site as it is now, seen here...

Thank you for your time. I appreciate it.

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 07/02/2014 08:16pm
By: Laugh

Can you try running the upgrade first on the current setup and then migrate it to your new server?

Your tables are not getting updating for some reason. Tom

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 08/02/2014 07:36am
By: remy

My view is that you can upgrade from x to y, but you cannot migrate from x to y (where y is on a new server).

So, Laugh is correct, migrate x to x on your new server, than install y,
Or upgrade x to y, than migrate to the new server.

Monkey the migrate sql contains drop-table's and recreates the database to the version from where it came from.

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 08/02/2014 11:03am
By: Habitual

Well, I am contemplating this suggestion, but I have a question or two...
Site A is the original 1.8.1 site.
Site B is a migrated copy at 1.8.1 and I've encountered no errors AFAICT.
The only plugin I wanted was GUS, so I installed this one.

Why can't I upgrade Site B to 2.0 (Can I skip 1.8.2sr1?)

I also see no table statement(s) for gl_sessions in any of the archives' flat files so this suggestion causes me to wonder if the table will be corrected by an upgrade.

I'll give it a go and see what happens and update this post after I do.

Thanks.

Update: Epic Fail, same error after enabling debug:
Upgrade 1.8.1 on Site B to 2.0.0...
PHP Formatted Code
If this is a production website you must disable this option once you have resolved any issues you are investigating.

256 - 1054: Unknown column 'whos_online' in 'field list' @ /var/www/system/databases/mysqli.class.php line 279

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 08/02/2014 08:35pm
By: Laugh

Migrate does upgrade at the same time I believe. I don't have access to my development server this week or I would ask you to email me your database so I could take a look.

The errors you posted don't deal with the actual upgrade process so I am not sure where it is exactly failing in the upgrade.

What you could do is look at the MySQL file in the Geeklog sql directory and find the gl_session table. Delete your table and recreate the gl_session table using the structure from the file. There are no records that need to be saved from the table. That should get rid of the current error you have but I am sure there will be more since the session table didn't get upgraded then, I am sure other tables like the story table and the topic table that got changed in Geeklog 2.0.0 didn't either. We also don't know if the configuration got updated with the new values.

Sorry I can't be of more help at the moment but I can take a closer look when I get back. BTW do you have a topic_assignments table? That is a new table in Geeklog 2.0.0.



Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 09/02/2014 03:52pm
By: Habitual

Tom:

Thanks for the assist.
I mis-spoke earlier when I said I didn't see any gl_sessions table statements in the archives' flat files. I forgot about the table prefix option and included the prefix "gl_" in my search.

It is present in geeklog-2.0.0/sql/mysql_tableanddata.php file as shows the two columns I seem to be missing. The same statement in 1.8.1/sql/mysql_tableanddata.php file doesn't have them.

Are you 100% certain that gl_topic_assignments is new to 2.0.0 ?
It it present in Site A's 1.8.1 db, a site I have never ran any updates on since its migration almost 2 years ago.

I have no problem dropping and re-creating a table that only holds transient data, so I may just try that. Smile It's right up my alley.

Thank you for your time.

JJ

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 09/02/2014 08:33pm
By: Habitual

Almost there!

3 Alter statements to the 1.8.1 db:
PHP Formatted Code

ALTER TABLE `dorkblog`.`gl_sessions`
ADD COLUMN `whos_online` TINYINT(1) NOT NULL DEFAULT '1',
ADD COLUMN `topic` VARCHAR(20) NOT NULL AFTER `whos_online`;
...
ALTER TABLE `dorkblog`.`gl_topics`
ADD COLUMN `parent_id` varchar(20) NOT NULL default 'root',
ADD COLUMN `inherit` tinyint(1) NOT NULL default '1';
...
ALTER TABLE `dorkblog`.`gl_users`
ADD COLUMN `stretch` int(8) unsigned NOT NULL default '1';
ADD COLUMN `salt`varchar(64) NOT NULL default '',
ADD COLUMN `algorithm` tinyint(3) NOT NULL default '0',


and then save the db to a newly exported file.sql and then I choose "Migrate" and select the file.

I see the screen that says it was successful, but not the screens following that, usually telling me what the db has but the director(y|ies) doesn't|don't.

The last hurdle is this message:
PHP Formatted Code

256 - 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE uid = 3' at line 1 @ /var/www/system/databases/mysqli.class.php line 279

Call Stack
#       Function        File    Line
1       trigger_error   /var/www/system/databases/mysqli.class.php      279
2       dbQuery /var/www/system/lib-database.php        213
3       DB_query        /var/www/system/lib-security.php        1298
4       SEC_updateUserPassword  /var/www/system/lib-security.php        1244
5       SEC_encryptUserPassword /var/www/system/lib-security.php        746
6       SEC_authenticate        /var/www/html/users.php 818
 array(3) {
  ["sql"]=>
  string(137) "UPDATE gl_users SET passwd = 'bb22cd7403595688fd81560a87b2f36a', salt = '8XhuZdIsRB8ge3IPY2ykKt', algorithm ='', stretch =  WHERE uid = 3"
  ["ignore_errors"]=>
  int(0)
  ["result"]=>
  bool(false)
}


Since it's barking about syntax, I have Server version: 5.1.71
Password resets bomb as well. Frown
Thanks for the help so far!

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 10/02/2014 08:19am
By: Laugh

This one I can't say until I look at the code. I am not sure why migration needs to update the user account


It is missing the algorithm and the stretch (which is what produces this error).

Maybe someone else can take a look or you will have to wait until I get back.

Does your site actually run now if you go to the homepage?

Tom

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 10/02/2014 08:55am
By: Habitual

Quote by: Laugh

Maybe someone else can take a look or you will have to wait until I get back.

Does your site actually run now if you go to the homepage?

Tom



Tom, I can wait and yes it runs, if I don't login. So I'm good with that for now.

Thanks.

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 10/02/2014 09:11am
By: Laugh

Do you mean it error's out when you log in or you just can't login?

If you can't login you should be able to update your admin user record with the default Admin user record that is found in the Geeklog 2.0.0 MySQL file. Just replace everything in the user record except the id and you should be able to then login with the default password.

Tom

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 10/02/2014 11:19am
By: Habitual

Quote by: Laugh

Do you mean it error's out when you log in or you just can't login?

If you can't login you should be able to update your admin user record with the default Admin user record that is found in the Geeklog 2.0.0 MySQL file. Just replace everything in the user record except the id and you should be able to then login with the default password.

Tom



Either trying to login, or a password reset throws an error.

It looks like this statement from line 828 in .../geeklog-2.0.0/sql/mysql_tableanddata.php:
PHP Formatted Code
$_DATA[] = "INSERT INTO {$_TABLES['users']} (uid, username, fullname, passwd, email, homepage, sig, regdate, cookietimeout, theme, status) VALUES (2,'Admin','Geeklog SuperUser','5f4dcc3b5aa765d61d8327deb882cf99','root@localhost','http://www.geeklog.net/','',NOW(),28800,NULL,3) ";


which seems consistent with
PHP Formatted Code
UPDATE gl_users SET passwd = '5f4dcc3b5aa765d61d8327deb882cf99' WHERE uid = 2;
from http://wiki.geeklog.net/index.php/Manually_creating_a_new_Admin_user

which I've tried and it failed to allow admin to login with the default password as well.
PHP Formatted Code
256 - 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE uid = 2' at line 1 @ /var/www/system/databases/mysqli.class.php line 279
Call Stack
#       Function        File    Line
1       trigger_error   /var/www/system/databases/mysqli.class.php      279
2       dbQuery /var/www/system/lib-database.php        213
3       DB_query        /var/www/system/lib-security.php        1298
4       SEC_updateUserPassword  /var/www/system/lib-security.php        1244
5       SEC_encryptUserPassword /var/www/system/lib-security.php        746
6       SEC_authenticate        /var/www/html/users.php 818

array(3) {
  ["sql"]=>
  string(137) "UPDATE gl_users SET passwd = 'e1ba810f778535eab5cbe009b8c22fc2', salt = 'lgl9T0moeovWtNZ1qMqI6Y', algorithm ='', stretch =  WHERE uid = 2"
  ["ignore_errors"]=>
  int(0)
  ["result"]=>
  bool(false)
}


Seems it dislikes /var/www/system/databases/mysqli.class.php line 279 for "some reason".

Thank you for your time.

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 10/02/2014 12:33pm
By: remy

It seems that the new fields (to 2.0.0) salt, algorithm and stretch are disturbing your login.

The error in the sql is due to the field stretch not having a value:

PHP Formatted Code
"UPDATE gl_users SET passwd = 'e1ba810f778535eab5cbe009b8c22fc2', salt = 'lgl9T0moeovWtNZ1qMqI6Y', algorithm ='', stretch =  WHERE uid = 2"


Maybe the manual sql will help:

PHP Formatted Code
"UPDATE gl_users SET passwd = 'e1ba810f778535eab5cbe009b8c22fc2', salt = 'lgl9T0moeovWtNZ1qMqI6Y', algorithm ='0', stretch = '1'  WHERE uid = 2"


Refer to the .../geeklog-2.0.0/sql/mysql_tableanddata.php for their initial values.
Maybe even the salt field should be empty (?) on the reset; it is not set on upgrade.

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 10/02/2014 02:11pm
By: Habitual

Thanks remy:

That or a variation of it didn't work
PHP Formatted Code
 UPDATE gl_users SET passwd = '5f4dcc3b5aa765d61d8327deb882cf99', salt = 'lgl9T0moeovWtNZ1qMqI6Y', algorithm ='0', stretch = '1'  WHERE uid = 2;

or
PHP Formatted Code
UPDATE gl_users SET passwd = '5f4dcc3b5aa765d61d8327deb882cf99', salt = '', algorithm ='0', stretch = '1'  WHERE uid = 2;


It just kicks me to the "did you forget your password" screen after admin/password is entered (same as any valid user really)

What gets me is this:
PHP Formatted Code
string(137) "UPDATE gl_users SET passwd = '002508e6ea56ca3544075c2b1049ce43', salt = 'Ifyn5GqLKVPSPTbjr0hPIT', algorithm ='', stretch =  WHERE uid = 2"
Why is it trying to UPDATE the password field for the admin user?

I ran this from line 828 of geeklog-2.0.0/sql/mysql_tableanddata.php:
PHP Formatted Code
INSERT INTO gl_users (uid, username, fullname, passwd, email, homepage, sig, regdate, cookietimeout, theme, status) VALUES (9,'Admin2','Geeklog SuperUser','5f4dcc3b5aa765d61d8327deb882cf99','root@localhost','http://www.geeklog.net/','',NOW(),28800,NULL,3);


same result Try Logging in Again
You may have mistyped your login credentials.


I think I'm going to wait for Tom to "get back" as he offered to have a look at my db.

Thanks for all the help though, I appreciate the effort!

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 10/02/2014 07:06pm
By: Habitual

I think I'll just stay at 1.8.1 on the new site.
It's been reliable.

And if it's not broke, why should I fix it?

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 08/01/2015 08:58am
By: DemeX

Hallo,

i'm having the same problem upgrading from 1.8 to 2.1, the upgrade script it's giving a blank page and the database is not being updated. I tried the upgrade, first migrating, after upgrading in my hosting and in a virtual box, but the result is the same, i can migrate but not upgrade. I tried fix the database manually, but i have not enough SQL skills... It's an old site since Geklog 1.3 (10 years more or less). I spent too many hours with this problem, the erros are the same explained above.

Quote by: Habitual

I think I'll just stay at 1.8.1 on the new site.
It's been reliable. And if it's not broke, why should I fix it?



Because i think 1.8 will not receive any more security updates, and the same with the plugins working in 1.8. In some date can be security vulnerabilities in the wild affecting 1.8 or some outdated plugins. For me, security is one of the main reasons to use Geeklog, if i do not feel secure i will migrate to another CMS. In ten years i have only one security problem with the MediaGallery plugin. Geeklog is rock solid and performs nice, but if i can not keep it updated i will switch.


Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 08/01/2015 09:51am
By: remy

The version 1.8.2sr1 is ignored, so that's probably why there is no database upgrade at all. And perhaps the version string '1.8.2sr1' is not a legal version, though it is displayed with version check. Same for 1.7.2sr.

Found in readme's of the 1.8.2sr1 upgrade:
PHP Formatted Code

Then edit public_html/siteconfig.php and change the version number to 1.8.2sr1
like so:
  define('VERSION', '1.8.2sr1');
 


I tend to think that resetting the version string is a solution.


Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 09/01/2015 06:29am
By: Laugh

Did Remy suggestion work for you?

The other thing I would try is disabling any plugin (in the plugin manager) that is not installed with Geeklog itself.

Between Geeklog 1.8.x and 2.X.0 there was a number of changes that required certain plugins to be updated before you could proceed to upgrading Geeklog (unless you disabled the plugins or uninstalled them).

Re: upgrade issues fom 1.8.2sr1 to 2.0.0

Posted on: 11/01/2015 12:52pm
By: DemeX

Hello,

thanks for the answers but is not working with all the plugins disabled and changing the version to "1.8.2".

I think can be related to the collation of the database, all my tables and the database are defined to latin1_swedish_ci, i don not why, my web is in spanish, but works fine. I will try changing the collation of the database before the upgrade and i think i will have to check the database schema, perhaps in a earlier upgrade some tables could be left in an worng/obsolete state...


Solved

Posted on: 11/01/2015 03:34pm
By: DemeX

Hi,

i have done the upgrade fine. After comparing my database with a fresh install database i have seen several inconsistencies:

- There were more 3 tables: gl_topics_assigment, gl_listarchive and gl_listpermissions (the last 2 from one plugin i am not using now). I have dropped the three.
- There are a new table gl_maillist. I have copied the structure and data to my database.

After i have run the upgrade script and had worked at the first time. Now i'm going for the forum...

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=95582