[MediaWiki-l] Error converting MediaWiki database from 1.4.5 to 1.5.8

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[MediaWiki-l] Error converting MediaWiki database from 1.4.5 to 1.5.8

Geert Van Pamel
I try to convert a MediaWiki database from 1.4.5 to 1.5.8 (yes I know I am a bit late. but up to now the database has perfectly
served me ever since 2005). We now want to migrate to a new Linux server, so we want to upgrade to the latest available version.

 

I understood I should first migrate to 1.5 first.

 

So I downloaded  <https://releases.wikimedia.org/mediawiki/1.5/mediawiki-1.5.8.tar.gz>
https://releases.wikimedia.org/mediawiki/1.5/mediawiki-1.5.8.tar.gz

 

I follow the script on https://www.mediawiki.org/wiki/Manual:Upgrading

 

But I receive the following error message:

 

php maintenance/upgrade1_5.php

 

2017-06-25 15:09:10: Checking cur table for unique title index and applying if necessary

wiki: cur table has the current unique index; no duplicate entries.

2017-06-25 15:09:10: ...converting from cur/old to page/revision/text DB structure.

2017-06-25 15:09:10: Creating page and revision tables...

2017-06-25 15:09:10: Last old record is 31158

......Moving text from cur.

2017-06-25 15:09:10: Last cur entry is 31970

PHP Notice:  mysql_query(): Function called without first fetching all rows from a previous unbuffered query in
/var/www/html/bike/includes/Database.php on line 349

2017-06-25 15:09:11:   0.31% done on old; ETA 2017-06-25 15:12:48 [100/31970] 147.11/sec

2017-06-25 15:09:11: 100.00% done on old (last chunk 0 rows).

Unable to free MySQL result

 

Backtrace:

GlobalFunctions.php line 513 calls wfBacktrace()

Database.php line 495 calls wfDebugDieBacktrace()

FiveUpgrade.inc line 426 calls Database::freeResult()

FiveUpgrade.inc line 49 calls FiveUpgrade::upgradePage()

upgrade1_5.php line 22 calls FiveUpgrade::upgrade()

 

The following (empty) tables are created:

xxx_page;

xxx_revision;

 

All of the other V1.5 tables are still missing.

 

*         How could I avoid the above error?

*         What could I have done wrong/missing

 

 

vi /var/www/html/bike/includes/Database.php

:349

        function doQuery( $sql ) {

                if( $this->bufferResults() ) {

                        $ret = mysql_query( $sql, $this->mConn );

                } else {

                        $ret = mysql_unbuffered_query( $sql, $this->mConn );

                }

                return $ret;

 

 

Geert Van Pamel



 

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error converting MediaWiki database from 1.4.5 to 1.5.8

Paul
Latest version is 1.28.2

Sent from my iPhone

> On Jun 25, 2017, at 11:54, Geert Van Pamel <[hidden email]> wrote:
>
> I try to convert a MediaWiki database from 1.4.5 to 1.5.8 (yes I know I am a bit late. but up to now the database has perfectly
> served me ever since 2005). We now want to migrate to a new Linux server, so we want to upgrade to the latest available version.
>
>
>
> I understood I should first migrate to 1.5 first.
>
>
>
> So I downloaded  <https://releases.wikimedia.org/mediawiki/1.5/mediawiki-1.5.8.tar.gz>
> https://releases.wikimedia.org/mediawiki/1.5/mediawiki-1.5.8.tar.gz
>
>
>
> I follow the script on https://www.mediawiki.org/wiki/Manual:Upgrading
>
>
>
> But I receive the following error message:
>
>
>
> php maintenance/upgrade1_5.php
>
>
>
> 2017-06-25 15:09:10: Checking cur table for unique title index and applying if necessary
>
> wiki: cur table has the current unique index; no duplicate entries.
>
> 2017-06-25 15:09:10: ...converting from cur/old to page/revision/text DB structure.
>
> 2017-06-25 15:09:10: Creating page and revision tables...
>
> 2017-06-25 15:09:10: Last old record is 31158
>
> ......Moving text from cur.
>
> 2017-06-25 15:09:10: Last cur entry is 31970
>
> PHP Notice:  mysql_query(): Function called without first fetching all rows from a previous unbuffered query in
> /var/www/html/bike/includes/Database.php on line 349
>
> 2017-06-25 15:09:11:   0.31% done on old; ETA 2017-06-25 15:12:48 [100/31970] 147.11/sec
>
> 2017-06-25 15:09:11: 100.00% done on old (last chunk 0 rows).
>
> Unable to free MySQL result
>
>
>
> Backtrace:
>
> GlobalFunctions.php line 513 calls wfBacktrace()
>
> Database.php line 495 calls wfDebugDieBacktrace()
>
> FiveUpgrade.inc line 426 calls Database::freeResult()
>
> FiveUpgrade.inc line 49 calls FiveUpgrade::upgradePage()
>
> upgrade1_5.php line 22 calls FiveUpgrade::upgrade()
>
>
>
> The following (empty) tables are created:
>
> xxx_page;
>
> xxx_revision;
>
>
>
> All of the other V1.5 tables are still missing.
>
>
>
> *         How could I avoid the above error?
>
> *         What could I have done wrong/missing
>
>
>
>
>
> vi /var/www/html/bike/includes/Database.php
>
> :349
>
>        function doQuery( $sql ) {
>
>                if( $this->bufferResults() ) {
>
>                        $ret = mysql_query( $sql, $this->mConn );
>
>                } else {
>
>                        $ret = mysql_unbuffered_query( $sql, $this->mConn );
>
>                }
>
>                return $ret;
>
>
>
>
>
> Geert Van Pamel
>
>
>
>
>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error converting MediaWiki database from 1.4.5 to 1.5.8

Tim Starling-2
In reply to this post by Geert Van Pamel
On 26/06/17 01:54, Geert Van Pamel wrote:
> I try to convert a MediaWiki database from 1.4.5 to 1.5.8 (yes I know I am a bit late. but up to now the database has perfectly
> served me ever since 2005). We now want to migrate to a new Linux server, so we want to upgrade to the latest available version.

Well done running 1.4 for so long, you are very special.

> PHP Notice:  mysql_query(): Function called without first fetching all rows from a previous unbuffered query in
> /var/www/html/bike/includes/Database.php on line 349

We eventually stopped using unbuffered queries, because of issues like
this. You can either figure out why mysql_query() is being called and
fix it, or you can convert the query to a buffered query. A buffered
query means trying to fit the entire result into memory, which is more
feasible on 2017 hardware than 2005 hardware!

You will need enough memory to fit the largest table into memory, not
including the "old" table since it is renamed not copied.

diff --git a/includes/Database.php b/includes/Database.php
index 06c4b61..d99f8ce 100644
--- a/includes/Database.php
+++ b/includes/Database.php
@@ -359,7 +359,7 @@ class Database {
  * @param string $sql SQL query.
  */
  function doQuery( $sql ) {
- if( $this->bufferResults() ) {
+ if( true || $this->bufferResults() ) {
  $ret = mysql_query( $sql, $this->mConn );
  } else {
  $ret = mysql_unbuffered_query( $sql, $this->mConn );

After you've upgraded, please run

ALTER TABLE <table name> CONVERT TO CHARACTER SET binary;

on all your tables, to avoid having UTF-8 stored as latin1, which can
easily cause corrupted backups.

-- Tim Starling


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error converting MediaWiki database from 1.4.5 to 1.5.8

Geert Van Pamel
Tim,

Your proposal to use buffered query worked. Thanks for that.

Now I am running into the following problem:


2017-06-28 22:49:58: Migrating image table to image_temp...
PHP Fatal error:  Call to undefined function wfGetMimeMagic() in /var/www/html/mediawiki/mediawiki-1.5.8/maintenance/FiveUpgrade.inc on line 709

-- Geert

-----Original Message-----
From: MediaWiki-l [mailto:[hidden email]] On Behalf Of Tim Starling
Sent: Monday, June 26, 2017 1:12 AM
To: [hidden email]
Subject: Re: [MediaWiki-l] Error converting MediaWiki database from 1.4.5 to 1.5.8

On 26/06/17 01:54, Geert Van Pamel wrote:
> I try to convert a MediaWiki database from 1.4.5 to 1.5.8 (yes I know
> I am a bit late. but up to now the database has perfectly served me ever since 2005). We now want to migrate to a new Linux server, so we want to upgrade to the latest available version.

Well done running 1.4 for so long, you are very special.

> PHP Notice:  mysql_query(): Function called without first fetching all
> rows from a previous unbuffered query in
> /var/www/html/bike/includes/Database.php on line 349

We eventually stopped using unbuffered queries, because of issues like this. You can either figure out why mysql_query() is being called and fix it, or you can convert the query to a buffered query. A buffered query means trying to fit the entire result into memory, which is more feasible on 2017 hardware than 2005 hardware!

You will need enough memory to fit the largest table into memory, not including the "old" table since it is renamed not copied.

diff --git a/includes/Database.php b/includes/Database.php index 06c4b61..d99f8ce 100644
--- a/includes/Database.php
+++ b/includes/Database.php
@@ -359,7 +359,7 @@ class Database {
  * @param string $sql SQL query.
  */
  function doQuery( $sql ) {
- if( $this->bufferResults() ) {
+ if( true || $this->bufferResults() ) {
  $ret = mysql_query( $sql, $this->mConn );
  } else {
  $ret = mysql_unbuffered_query( $sql, $this->mConn );

After you've upgraded, please run

ALTER TABLE <table name> CONVERT TO CHARACTER SET binary;

on all your tables, to avoid having UTF-8 stored as latin1, which can easily cause corrupted backups.

-- Tim Starling


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error converting MediaWiki database from 1.4.5 to 1.5.8

Tim Starling-2
On 29/06/17 09:15, Geert Van Pamel wrote:
> Tim,
>
> Your proposal to use buffered query worked. Thanks for that.
>
> Now I am running into the following problem:
>
>
> 2017-06-28 22:49:58: Migrating image table to image_temp...
> PHP Fatal error:  Call to undefined function wfGetMimeMagic() in /var/www/html/mediawiki/mediawiki-1.5.8/maintenance/FiveUpgrade.inc on line 709

Make sure your source tree is clean and correct, and make sure the
current directory is not set to the base of some other MediaWiki
installation. That function should definitely exist in the
GlobalFunctions.php of MW 1.5.8, but GlobalFunctions.php is loaded via
include_path which could be wrong.

-- Tim Starling


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Loading...