Re: db file too humungous

Reini Urban <[email protected]> Sun, 07 Dec 2008 15:28:31 +0100
Newsgroups gmane.comp.web.wiki.phpwiki.talk
Message-ID <[email protected]>
Ale Fernandez schrieb:
> Sorry how do I despam it on the command line?
> 
> Thanks for the reply! I had given up completely
> 
> Ale
> 
> Reini Urban wrote:
>> Ale Fernandez schrieb:
>>> Hi,
>>>
>>> I have a problem that an old phpwiki site I used to run has got 
>>> spammed into a spam sandwich that would have scooby doo sweating. 
>>> It's 2 gb or so in size.
> <snip>
>>> -------------------
>>>
>>> Is there a way to fix this, or a way to connect directly to the db 
>>> file so as to delete the masses of spam comments?
>>
>> The sqlite extension might work with such a file handle once opened,
>> but the PHP is_file() obviously cannot handle > 2GB.
>>
>> I would try to despam it up on the commandline. Or work with a smaller 
>> backup.

open the file with sqlite and delete some pages and versions you don't 
need to be able to get under 2GB.

$ sqlite /var/lib/phpwiki/phpwiki_pagedb.db
SQLite version 2.8.17
Enter ".help" for instructions
sqlite> .tables
link      nonempty  page      pref      recent    session   version
sqlite> select pagename,version.id,version.version,content from 
page,version where page.id=version.id order by mtime limit 10;
...
sqlite> delete from version where id=<bla> and version=<bla>;


-- 
Reini Urban
http://phpwiki.org/  http://murbreak.at/

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/