Brion Vibber | 2 Dec 2003 15:14
Picon
Favicon
Gravatar

Re: Documentation: import of database dump, mod_rewrite rules

On Nov 30, 2003, at 15:23, Agon S. Buchholz wrote:
>   "Error in the database. There was an syntax error in the database
>   query. The last database query was: "INSERT INTO rebuildlinks
>   (rl_f_id,rl_f_title,rl_to) VALUES " from the fuction "".
>   MySQL reported error "1064: You have an error in your SQL syntax."

The new rebuildlinks script is heavily rewritten; you may wish to grab 
the current dev branch out of CVS (which we're running now on 
Wikipedia) or wait a few days for the new stable release.

> (1b) When just importing cur_, rebuildlinks.php runs fine, but when 
> accessing the Main_Page ("Hauptseite"), it says that there are "0 
> articles", but the wiki pages exist, in this case, several thousend 
> pages. Is this the wanted behaviour, or is there something else to do 
> after running rebuildlinks.php? Also, newly created pages are not 
> being counted.

To rebuild the article count manually:
SELECT  <at> foo:=COUNT(*) FROM cur
   WHERE cur_namespace=0 AND cur_is_redirect=0 AND cur_text like '%[[%';
UPDATE site_stats SET ss_good_articles= <at> foo;

> The statement references to an external RewriteMap which I couldn't 
> find:
>
>  RewriteMap ampescape int:ampescape
>  RewriteRule ^/wiki/(.*)$ /wiki.phtml?title=${ampescape:$1} [L]
>
> The ../maintenance directory contains just apache-ampersand.diff. Is 
> the RewriteMap used by Wikipedia somewhere publicly available?
(Continue reading)

Tim M. Sanders | 4 Dec 2003 23:00

configuration and mod_rewrite

I run on Redhat 9.0 with Apache 2.x, PHP 4.2.2 (old I know).

The problem is with the sample LocalSettings.sample (cp to LocalSettings.php) I
believe.  I have the following in my LocalSettings.php file:

	$wgSitename         = "Synergypedia";
	$wgMetaNamespace    = FALSE; # will be same as you set $wgSitename

	$wgServer           = "http://sledge";
	$wgScriptPath       = "/synergypedia";
	$wgArticlePath      = "{$wgScript}?title=$1";
	$wgEmergencyContact = "tsanders@...";

However, when I access some of the links on the Main Page (via
http://sledge/synergypedia/wiki.phtml), the links contain /wiki instead of
/synergypedia.  I seems that the php vars in DefaultSettings.php are not getting
set appropriately based on the settings in the LocalSettings.phph file.  Do I
need to copy the entire block of corresponding links from the
DefaultSettings.php file to override all of them?  I don't know the variable
substituion rules for php.  If I copy the block of vars it works.

	$wgSitename         = "Synergypedia";
	$wgMetaNamespace    = FALSE; # will be same as you set $wgSitename

	#$wgServer           = "http://sledge" . getenv( "SERVER_NAME" );
	$wgServer           = "http://sledge";
	$wgScriptPath       = "/synergypedia";
	$wgScript           = "{$wgScriptPath}/wiki.phtml";
	$wgRedirectScript   = "{$wgScriptPath}/redirect.phtml";
	$wgStyleSheetPath   = "{$wgScriptPath}/style";
(Continue reading)

Brion Vibber | 4 Dec 2003 23:04
Picon
Favicon
Gravatar

Re: configuration and mod_rewrite

On Dec 4, 2003, at 14:00, Tim M. Sanders wrote:
>  Do I
> need to copy the entire block of corresponding links from the
> DefaultSettings.php file to override all of them?  I don't know the 
> variable
> substituion rules for php.  If I copy the block of vars it works.

A string interpolation (variable reference inside a string literal) is 
evaluated at the time the string is evaluated. So, if you set the 
variable _after_ it's used, it's too late. You now need to set it 
again.

> RewriteEngine On
> RewriteRule ^/synergypedia/(.*)$ /synergypedia/wiki.phtml?title=$1 [L]

I'd recommend keeping wiki.phtml and the other 'real files' separate 
from the virtual rewritten "directory" for the wiki pages. For instance 
on Wikipedia we have /wiki/ for the wiki pages and /w/ for the scripts 
and /style/ for the stylesheets, etc. So nothing gets too confused.

-- brion vibber (brion  <at>  pobox.com)
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l@...
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Evan Prodromou | 6 Dec 2003 03:05
Gravatar

UTF-8 Conversion

So, Wikitravel uses the default ISO-8859-1 encoding, and we're
starting to need UTF-8 characters.

I think the process for converting might be as follows:

1. Shut down the site.
2. Backup the database with a data dump.
3. iconv the dump file to UTF-8.
4. Twiddle with mysql till it knows to use UTF-8.
5. Twiddle with PHP's php.ini till it knows to use UTF-8.
6. Change the encoding in LocalSettings.php to use UTF-8.
7. Delete everything in the database.
8. Import the data dump back in.
9. Turn the site back on.
10. Hope for the best.

Does this sound about right? Have any other MediaWiki installations
switched encodings midstream like this?

~ESP

--

-- 
Evan Prodromou <evan@...>
Wikitravel - http://www.wikitravel.org/
The free, complete, up-to-date and reliable world-wide travel guide
Evan Prodromou | 6 Dec 2003 23:05
Gravatar

Re: UTF-8 Conversion

>>>>> "EP" == Evan Prodromou <evan@...> writes:

    EP> So, Wikitravel uses the default ISO-8859-1 encoding, and we're
    EP> starting to need UTF-8 characters.

    EP> I think the process for converting might be as follows:

    EP> 3. iconv the dump file to UTF-8. [...]
    EP> 8. Import the data dump back in. 

OK, so, this won't work. linkscc has binary data in it that mucks up
the dump file.

I think maybe skipping the linkscc table, and rebuilding it
afterwards, might work.

~ESP

--

-- 
Evan Prodromou <evan@...>
Wikitravel - http://www.wikitravel.org/
The free, complete, up-to-date and reliable world-wide travel guide
Brion Vibber | 7 Dec 2003 11:57
Picon
Favicon
Gravatar

Re: UTF-8 Conversion

On Dec 6, 2003, at 14:05, Evan Prodromou wrote:
>     EP> 3. iconv the dump file to UTF-8. [...]
>     EP> 8. Import the data dump back in.
>
> OK, so, this won't work. linkscc has binary data in it that mucks up
> the dump file.
>
> I think maybe skipping the linkscc table, and rebuilding it
> afterwards, might work.

The only tables that should contain binary data at present are linkscc 
(gzipped data) and math (a binary hash value). Both of these tables' 
contents are volatile: you can just clear them out, and they will be 
regenerated when needed.

-- brion vibber (brion  <at>  pobox.com)
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l@...
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Brion Vibber | 7 Dec 2003 12:06
Picon
Favicon
Gravatar

New MediaWiki stable release coming soon

Now that the dev branch is pretty well broken in on Wikipedia, it's my 
intention to branch and release a new 'stable' version in the next day.

If there are any real show-stopper bugs remaining, please say something!

-- brion vibber (brion  <at>  pobox.com)
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l@...
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Freerk | 7 Dec 2003 21:56
Picon

Why run rebuildlinks.php after database update?

Hello mediawiki-l,

      On http://de.wikipedia.org/wiki/Wikipedia:Download and other
      wikipedia download sites I found a tutorial on updating my local
      database with the wikipedia mysql dump. It says afterwords you
      have to do a "php rebuildlinks.php". But why? Well, I assume it
      rebuilds some links but which ones? I thought everything is
      dynamic in the database, and the only links are in the
      cur_table, which I updated with a mysql command.

      I didn't understand the php source, either.

      Or isn't it necessary? Thanks for your answers in advance.

--

-- 
Best regards,
 Freerk                          mailto:freerk@...
Evan Prodromou | 7 Dec 2003 22:43
Gravatar

Re: New MediaWiki stable release coming soon

>>>>> "BV" == Brion Vibber <brion@...> writes:

    BV> Now that the dev branch is pretty well broken in on Wikipedia,
    BV> it's my intention to branch and release a new 'stable' version
    BV> in the next day.

    BV> If there are any real show-stopper bugs remaining, please say
    BV> something!

So, I'm holding off on a couple of RFEs (having to do with uploading
files) until this merge happens.

~ESP

--

-- 
Evan Prodromou <evan@...>
Wikitravel - http://www.wikitravel.org/
The free, complete, up-to-date and reliable world-wide travel guide
Brion Vibber | 8 Dec 2003 02:18
Picon
Favicon
Gravatar

Re: Why run rebuildlinks.php after database update?

On Dec 7, 2003, at 12:56, Freerk wrote:
>       On http://de.wikipedia.org/wiki/Wikipedia:Download and other
>       wikipedia download sites I found a tutorial on updating my local
>       database with the wikipedia mysql dump. It says afterwords you
>       have to do a "php rebuildlinks.php". But why? Well, I assume it
>       rebuilds some links but which ones? I thought everything is
>       dynamic in the database, and the only links are in the
>       cur_table, which I updated with a mysql command.

There are presently three link tables:
'links' tracks all "live" links from wikipages to other wikipages that 
do exist;
'brokenlinks' tracks "broken" links, those that go to pages that don't 
yet exist;
'imagelinks' tracks usage of images in wikipages.

There are a couple of uses for these tables:
- enables "What links here" and "Related changes" to work, looking at 
incoming or outgoing links
- provides the list of pages that use an image shown on an image's 
description page
- allows making reports of pages that aren't linked (Orphans, Unused 
images) or are linked to but don't exist (Most wanted pages)
- slightly speed up page rendering by avoiding individual checks for 
the existence of each linked page to determine how to render its link

(The latest software also adds a 'linkscc' table which caches data from 
the other three tables. This is used only for speeding rendering.)

If you import data to the cur table and don't rebuild the links, you 
(Continue reading)


Gmane