Hi!
Moving a Mediawiki installation from one server to an other with
tar -cvpzf mediawiki.tgz /mediawiki
pg_dump -U adminuser -W -h database-host -f mediawiki.sql
on the new database server:
su - postgres
createdb wikidb
createuser wikidb
- none admin
- allow creation of databases
- disallow grants
psql:
alter role wikidb with password 'wikidbuserpass';
\q
then on the wikiserver:
psql -U adminuser -h databaseserver -W -f mediawiki.sql 2>&1\
| tee dbimport.log
Only six errors:
psql:mediawiki.sql:1114: ERROR:\
functiongin_extract_tsquery(pg_catalog.tsquery,\
internal, smallint) does not exist
psql:mediawiki.sql:1117: ERROR:\
operator class "gin_tsvector_ops" does not exist\
for access method "gin"
psql:mediawiki.sql:1134: ERROR:\
function gtsquery_consistent(bigint, internal,\
integer) does not exist
psql:mediawiki.sql:1137: ERROR:\
operator class "gist_tp_tsquery_ops" does not\
exist for access method "gist"
psql:mediawiki.sql:1153: ERROR:\
function gtsvector_consistent(pg_catalog.gtsvector,\
internal, integer) does not exist
psql:mediawiki.sql:1156: ERROR:\
operator class "gist_tsvector_ops" does not exist\
for access method "gist"
IMHO these relations missing isn't fatal.
Next step: unpacking the mediawiki itself:
tar -xvzf mediawiki.tgz
Double checking all paths and configurations, then enabling the site
in apache2. All OK, no errors so far. Having moved "LocalConfig.php"
out of the way MediaWiki responds with its installation page.
Now moving "LocalConfig.php" to its place again, then accessing
our MediaWiki leads to:
Warning: pg_query(): Query failed: ERROR: relation "objectcache"
does not exist LINE 1: ...diaWikiBagOStuff::_doquery */
value,exptime FROM objectcach... ^ in
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/db/DatabasePostgres.php
on line 580 Warning: pg_query(): Query failed: ERROR: relation
"objectcache" does not exist LINE 1: ...tuff::_doquery 87.157.7.114
*/ value,exptime FROM objectcach... ^ in
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/db/DatabasePostgres.php
on line 580 Warning: pg_query(): Query failed: ERROR: relation
"objectcache" does not exist LINE 1: ...tuff::_doquery 87.157.7.114
*/ value,exptime FROM objectcach... ^ in
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/db/DatabasePostgres.php
on line 580 Warning: pg_query(): Query failed: ERROR: relation
"objectcache" does not exist LINE 1: ...MediaWikiBagOStuff::_doquery
87.157.7.114 */ FROM objectcach... ^ in
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/db/DatabasePostgres.php
on line 580 Warning: pg_query(): Query failed: ERROR: relation
"objectcache" does not exist LINE 1: ...tuff::_doquery 87.157.7.114
*/ value,exptime FROM objectcach... ^ in
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/db/DatabasePostgres.php
on line 580 Warning: pg_query(): Query failed: ERROR: relation
"objectcache" does not exist LINE 1: ...MediaWikiBagOStuff::_doquery
87.157.7.114 */ FROM objectcach... ^ in
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/db/DatabasePostgres.php
on line 580 Warning: pg_query(): Query failed: ERROR: relation
"page" does not exist LINE 1: ...che::loadFromDB 87.157.7.114 */
page_title FROM page WHER... ^ in
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/db/DatabasePostgres.php
on line 580 MediaWiki internal error.
Original exception: exception 'DBUnexpectedError' with message 'A
database error has occurred
Query: SELECT value,exptime FROM objectcache WHERE
keyname='wikiaa:messages:en'
Function: MediaWikiBagOStuff::_doquery
Error: 1 ERROR: relation "objectcache" does not exist
LINE 1: ...diaWikiBagOStuff::_doquery */ value,exptime FROM
objectcach...
^
' in
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/db/DatabasePostgres.php:1063
Stack trace:
#0
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/db/Database.php(616):
DatabasePostgres->reportQueryError('ERROR: relatio...', 1, 'SELECT
value,ex...', 'MediaWikiBagOSt...', false)
#1
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/BagOStuff.php(454):
Database->query('SELECT value,ex...', 'MediaWikiBagOSt...')
#2
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/BagOStuff.php(324):
MediaWikiBagOStuff->_doquery('SELECT value,ex...')
#3
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/BagOStuff.php(240):
SqlBagOStuff->_query('SELECT value,ex...', 'wikiaa:messages...')
#4
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/MessageCache.php(245):
SqlBagOStuff->get('wikiaa:messages...')
#5
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/MessageCache.php(589):
MessageCache->load('en')
#6
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/MessageCache.php(526):
MessageCache->getMsgFromNamespace('Mainpage', 'en')
#7 [internal function]: MessageCache->get('mainpage', true, true)
#8
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/StubObject.php(58):
call_user_func_array(Array, Array)
#9
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/StubObject.php(76):
StubObject->_call('get', Array)
#10 [internal function]: StubObject->__call('get', Array)
#11
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/GlobalFunctions.php(598):
StubObject->get('mainpage', true, true)
#12
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/GlobalFunctions.php(563):
wfMsgGetKey('mainpage', true, true, true)
#13
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/GlobalFunctions.php(511):
wfMsgReal('mainpage', Array, true, true)
#14
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/Title.php(287):
wfMsgForContent('mainpage')
#15
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/Wiki.php(110):
Title::newMainPage()
#16
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/index.php(60):
MediaWiki->checkInitialQueries(NULL, 'view')
#17 {main}
Exception caught inside exception handler: exception
'DBUnexpectedError' with message 'A database error has occurred
Query: SELECT page_title FROM page WHERE page_is_redirect = '0' AND
page_namespace = '8' AND (page_title not like '%%/%%') AND (page_len
> 10000)
Function: MessageCache::loadFromDB
Error: 1 ERROR: relation "page" does not exist
LINE 1: ...che::loadFromDB 87.157.7.114 */ page_title FROM page WHER...
^
' in
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/db/DatabasePostgres.php:1063
Stack trace:
#0
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/db/Database.php(616):
DatabasePostgres->reportQueryError('ERROR: relatio...', 1, 'SELECT
page_ti...', 'MessageCache::l...', false)
#1
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/db/Database.php(1026):
Database->query('SELECT page_ti...', 'MessageCache::l...')
#2
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/MessageCache.php(339):
Database->select('page', 'page_title', Array, 'MessageCache::l...')
#3
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/MessageCache.php(268):
MessageCache->loadFromDB('en')
#4
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/MessageCache.php(589):
MessageCache->load('en')
#5
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/MessageCache.php(526):
MessageCache->getMsgFromNamespace('Internalerror', 'en')
#6
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/GlobalFunctions.php(598):
MessageCache->get('internalerror', true, false)
#7
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/GlobalFunctions.php(563):
wfMsgGetKey('internalerror', true, false, true)
#8
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/GlobalFunctions.php(469):
wfMsgReal('internalerror', Array, true)
#9
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/Exception.php(114):
wfMsg('internalerror')
#10
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/Exception.php(204):
MWException->getPageTitle()
#11
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/Exception.php(167):
MWException->htmlHeader()
#12
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/Exception.php(186):
MWException->reportHTML()
#13
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/Exception.php(284):
MWException->report()
#14
/aiomundo/www/xompu.de_subfolders/wiki/mediawiki-1.15.1/includes/Exception.php(344):
wfReportException(Object(DBUnexpectedError))
#15 [internal function]: wfExceptionHandler(Object(DBUnexpectedError))
#16 {main}
Since no tool displays the relations and tables created importing
the database, I could only have a look at the dump: relation
"objectcache" just doesn't exist, as relation "page" does not exist
within the dump (used psql-commands \l, \d, \dt. The graphical tool
had similar problems).
Shall I treat this as an error of MediaWiki or as one related to
PostgreSQL. As far as I see pg_dump does dump the whole database
into a file called the way I did.
--
Thomas