Re: How to upgrade MySQL DB from PHPWiki 1.3.12p2 to 1.3.14

"Reini Urban" <[email protected]>
Newsgroups gmane.comp.web.wiki.phpwiki.talk
Message-ID <[email protected]>
2007/8/10, Sacha Schär <[email protected]>:
> Hi there,
>
> my host provider recently upgraded PHP from 4.3.9 to 5.1.6, and on the
> same time, MySQL from 4.0 to 4.1.21.
>
> As a consequence, my Phpwiki version 1.3.12p2 stopped working.
> I got the following error:
>
>   Fatal error: Cannot redeclare hash() in
>   /home/httpd/vhosts/scanita.net/httpdocs/phpwiki_old/lib/stdlib.php
>   on line 1276
>
> (I do understand this problem)
>
>
> In order to fix it, I installed Phpwiki 1.3.14. But when I tried to use
>       the same DB as before, I got the following error:
>
>   lib/WikiDB/backend/PearDB.php:1059 Error[256]:
>   WikiDB_backend_PearDB_mysql: fatal database error
>
>       * DB Error: no such field
>       * (SELECT cached_html FROM page WHERE pagename='HomePage'
> [nativecode=1054 ** Unknown column 'cached_html' in 'field list'])
>       *
>
> (I do understand this problem too)
>
>
> I tried the upgrade action (.../phpwiki/index.php&action=upgrade), but
> this did not seem to work:
>
>   Upgrading this PhpWiki
>   check for necessary database updates - SQL
>   db version: we want 1030.14
>   db version: we have 0
>   Backend type: mysql
>   check for table session ...OK
>   check for table pref ...OK
>   check for table member ...OK
>   Rebuild entire database to upgrade relation links ...
>   Fatal Error:
>
>   lib/WikiDB/backend/PearDB.php:1059 Error[256]:
> WikiDB_backend_PearDB_mysql: fatal database error
>
>       * DB Error: no such field
>       * (INSERT INTO link (linkfrom, linkto, relation) VALUES (2, 3, 0)
>   [nativecode=1054 ** Unknown column 'relation' in 'field list'])
>      *
>
>   lib/WikiDB/backend/PearDB.php:98 Warning[512]: WARNING: database still
>    locked (lock_count = $this->_lock_count)
>
>       * <br />
>
>
> Here I do not understand what is going on.

Oops, upgrade error. I forgot something.
Best is to use your phpMyAdmin with the following snippet:

ALTER TABLE accesslog CHANGE remote_host VARCHAR(100);

<enter> // this may fail.

ALTER TABLE link ADD relation  INT DEFAULT 0;
CREATE INDEX link_relation ON link (relation);

<enter> // this is required.

And then optionally again ?action=upgrade to fill in the relations.


> I guess there are many possibilities to migrate the DB, but my knowledge
>   about PHP and MySQL are very limited (I'm willing to learn if
> necessary). I also have only limited rights on the host where I run the
> Wiki (Basically I can modify files inside the http directories, change
> permissions of these file and have access to phpMyAdmin 2.8.2.4).
>
> Can you guide me into the right direction, or maybe even present a
> simple solution for this?
>
> Thanks in advance for any help!
-- 
Reini Urban
http://phpwiki.org/              http://murbreak.at/
http://spacemovie.mur.at/   http://helsinki.at/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.