Hey everyone. Another researcher and I are finally getting around to
working on a project presented at Wikimania last year. The goal is to
redact information from a page before save and store it in a separate
database from the MW install. We have looked through and tested many of the
hooks on Manual:Hooks <http://www.mediawiki.org/wiki/Manual:Hooks> but have
not been able to find the right one or get it working properly. We have
implemented a tag extension, <redact></redact> and can successfully pull
information from another database and render it into the page, but we need
to strip any information between the tags before the page is saved and
replace the tag it with a token in the form <redact token="1234"></redact>.
Can anyone provide any guidance on what hook we should use to accomplish
this?
Thanks in advance.
Peter Gehres
Institute for Information Security
The University of Tulsa
> 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
The new user will also need to have the correct search_path set.
And the time zone and date display. This can be done manually or
just by rerunning the installer/updater. The latter is a step you
should always take when moving to a new wiki.
Alternatively, you could simply make sure you are also dumping all
the users in their entirety for the new wiki like so:
(old server) pg_dumpall --globals > users.pg
(new server) psql -f users.pg
--
Greg Sabino Mullane greg(a)endpoint.com
End Point Corporation
PGP Key: 0x14964AC8
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
Hello,
after a hardware failure, we restored the Wiki-Directory (MediaWiki
1.15.5) and the database (MySQL 5.0.18) from our backup.
But instead of the wiki pages we only get the following messages in the
php.log:
[Tue Mar 29 23:53:03 2011] [error] [client 127.0.0.1] PHP Notice:
Undefined variable: wgExtensionAssetsPath in
/srv/www/htdocs/w/includes/Setup.php on line 43
[Tue Mar 29 23:53:03 2011] [error] [client 127.0.0.1] PHP Notice:
Undefined variable: wgUseInstantCommons in
/srv/www/htdocs/w/includes/Setup.php on line 132
[Tue Mar 29 23:53:03 2011] [error] [client 127.0.0.1] PHP Notice:
Undefined variable: wgDebugPrintHttpHeaders in
/srv/www/htdocs/w/includes/Setup.php on line 187
[Tue Mar 29 23:53:03 2011] [error] [client 127.0.0.1] PHP Notice:
Undefined variable: wgHtml5Version in
/srv/www/htdocs/w/includes/Setup.php on line 248
[Tue Mar 29 23:53:03 2011] [error] [client 127.0.0.1] PHP Notice:
Undefined variable: wgHtml5 in /srv/www/htdocs/w/includes/Setup.php on
line 248
[Tue Mar 29 23:53:03 2011] [error] [client 127.0.0.1] PHP Fatal error:
Cannot instantiate abstract class SqlBagOStuff in
/srv/www/htdocs/w/includes/ObjectCache.php on line 85
The include_path in php.ini (PHP 5.2.17) contains the following directories:
include_path =
".:/usr/share/php5:/usr/share/php5/PEAR:/srv/www/htdocs/w/includes:/srv/www/htdocs/w:/opt/php-5.2.27/lib"
Obviously there's something missing, but what??
Thanks for any suggestions or hints,
Stefan
In a message dated 3/30/2011 9:23:57 AM Pacific Daylight Time,
overlordq(a)gmail.com writes:
> http://en.wikipedia.org/wiki/Wikipedia:Mirrors_and_forks#Remote_loading
>
Shades of past conversations. Being "Does mirroring *an* article, or even
a hundred make your site a *mirror*" ?
Personally I say no. Mirrors are copies, everything is shown.
Copying a few articles doesn't make you a "mirror".
But at any rate, http://meta.wikimedia.org/wiki/Live_mirrors
Seems to show over 150 live mirrors.
I expect the major effort is focused on those consuming the most resources.
That's what would make sense to me from an admin point of view.
Will
In a message dated 3/30/2011 8:45:10 AM Pacific Daylight Time,
overlordq(a)gmail.com writes:
> No, because remote loading is an unacceptable use of the website and
> likely to get you blocked. >>
>
I disagree with this opinion. Cite your source.
I get my best ideas when I can't do anything about them.
I was thinking about what happens on my wiki when a user clicks on a Red
Link now. On my drive back from my office I realized that I could write a
PHP, that queries for that page on en:Wikipedia and if it exists, pulls the
contents over and display it in my wiki as if it were there, but with a header
that it came from Wikipedia.
So these would be transitory pages, not really existing, but allowing the
user the experience of not leaving my site.
Is there already such a gizmo? Or am I going to have to Go Fish?
Will Johnson
Recently I discovered that the user_editcount column in the "user" table disagrees with the actual edits in the "revisions" table by a significant amount. To fix this, I ran maintenance/initEditCount.php. My question is: what causes these numbers to get out of sync in the first place? Should I need to run this maintenance script regularly?
This is MediaWiki 1.16.2 on a single server with a single database. The wiki began its life at 1.10.0, if that matters.
Thanks,
DanB
Hi,
I'am using at my local mediawiki the InstantCommons feature
$wgUseInstantCommons = true;
So when I use
[[File:Box-Plot mit Interquartilsabstand.png|thumb|Box-Plot mit Whiskern
der Länge 1,5×IQR]]
the graphics is displayed correctly. Since my wiki uses german as basic
language, I use also the german terms:
[[Datei:Box-Plot mit Min-Max Abstand.png|miniatur|Box-Plot derselben
Daten mit Whiskern vom Minimum bis zum Maximum der Daten]]
But this does not display the picture from commons, but a red link instead.
Any suggestions what to do?
Thanks in advance
Sigbert Klinke