[Mediawiki-l] Delete Histories, with multiple wikis and indiv databases

Tim Ware tim at hyperarts.com
Wed Dec 27 03:09:01 UTC 2006


My wikis are hosted at Dreamhost. They said to run php 5 from the  
command line I had to do this, which I did:

[cognac]$ /usr/local/php5/bin/php deleteOldRevisions.php --delete
X-Powered-By: PHP/5.1.2
Content-type: text/html

Delete Old Revisions

Searching for active revisions...done.
Searching for inactive revisions...done.
1 old revisions found.
Deleting...done.
Searching for active text records in revisions table...done.
Searching for active text records in archive table...done.
Searching for inactive text records...done.
1 inactive items found.
Deleting...done.

But it didn't delete the old histories, just one record. As I have  
mentioned I made the settings in AdminSettings.php:

$wgDBserver         = "mysql.mydomain.com";
$wgDBname           = "mydatabase";
$wgDBuser           = "myusername";
$wgDBpassword       = "mypassword";
$wgDBprefix         = "wiki_";
$wgDBtype           = "mysql";
$wgDBport           = "5432";

Weird.

Tim

Thanks Rob.

On 27/12/06, Rob Church wrote:
 > I then changed the name of that file to AdminSettings.pgp

That would have to be .php

OK.

> > X-Powered-By: PHP/4.4.4
> > Content-type: text/html
>
> >From the command line, what's being run is an old PHP 4.4 CGI, not  
> the
> PHP 5 that MediaWiki needs. You need to use the PHP 5 CLI to execute
> the script.
>
I'm not a strong command line guy. How do I execute a "PHP5 CLI"?
> I don't remember for sure, but I don't think deleteOldRevisions.php
> uses $wgDBadminuser &c - I suspect it falls back to the existing
> database settings, since those are all that's required.
>
> IIRC, maintenance scripts can be told to use a specific
> LocalSettings.php with the --config option at runtime.
>
Well, I'm not sure what a lot of that means, but I guess the command  
line would look like this:

php deleteOldRevisions.php  --delete --config LocalSettings-1.php

where I would create a LocalSettings-1.php and just include the  
settings for the db I want to delete histories for? In my  
LocalSettings I use php to check what subdomain the user is calling,  
then point to the settings for that wiki.

OK, I'm a bit confused.

Tim


> *Please* back up everything. :)


Rob Church




More information about the MediaWiki-l mailing list