[Mediawiki-l] Fixing database after lost images

Rolf Lampa rolf.lampa at rilnet.com
Mon May 14 13:50:43 UTC 2007


John Pye wrote:
> Hi Rolf,
>
> Rolf Lampa wrote:
>   
>> John Pye wrote:
>>   
>>     
>>> I tried to run management/rebuildImages using php5 CLI but it fails with
>>> a message about failing to connect to the database with user = root and
>>> no password. I couldn't see where to set the password (I tried modifying
>>> php.ini but that wasn't it). So I can't see how to run this script, either.
>>>   
>>>     
>>>       
>> Set user and pwd in the AdminSettings.php file, or if never used before 
>> it's probably named "AdminSettings.sample" (same root folder as 
>> LocalSettings.php). This file should contain the following text:
>>   
>>     
>
> Thanks that was exactly the problem. Somehow I missed setting up
> AdminSettings.php
>
> My problem now is that the image database has all these files that it
> expects to be there, but they're not there. Is there anything I can do
> to make the mediawiki database keep only the images for which the
> uploaded files are still present, ie not lost?
>
> I tried the 'importImages' script but it won't import lost images
> because they're still present in the database.
>
> I tried the 'cleanupImages' script but it doesn't seem to clean up anything.
>
> What seems to be required is a 'dropMissingImages' script or something
> like that. Depending on how the database is designed this might not be
> architecturally possible, I guess.
>
> Any thoughts?
>   

I haven't tried this myself, but since the Image page titles should be 
the same ass the file names on disk you could arrange, somehow, a list 
of file names with the titles which are not there any longer. And then 
"wrap" the names in the list with appropriate SQL-script which drops 
those image pages.

But as said, I haven't dived into this problem any deeper than just 
typing this, right now. It's just what comes to mind.

// Rolf Lampa


More information about the MediaWiki-l mailing list