Is there a way to trim old versions of articles you know you don't need anymore?
-Moonlight Embrace
Moonlight Embrace wrote:
Is there a way to trim old versions of articles you know you don't need anymore?
You can manually remove old entries from the 'old' table in the database.
(Be very careful doing this; if you change your mind or mistype it cannot be undone without restoring a backup of your database!)
To delete all old entries older than noon UTC on April 1, 2004:
DELETE FROM old WHERE old_timestamp < '20040401120000';
To delete the older entries only from a specific article:
DELETE FROM old WHERE old_timestamp < '20040401120000' AND old_namespace=0 AND old_title='Some_article_name';
The timestamps are 14 digits: year, month, day, hour, minutes, seconds, and always stored in UTC (GMT) rather than local time.
This will not affect current article versions, which are stored in a separate table in the database.
-- brion vibber (brion @ pobox.com)
Thanks. I can do that :). Is the history in another table, or is it just pulled from the old table?
-ME
----- Original Message ----- From: Brion Vibber brion@pobox.com To: MediaWiki announcements and site admin list mediawiki-l@Wikimedia.org Sent: Tuesday, August 17, 2004 1:36 PM Subject: Re: [Mediawiki-l] trimming the database
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Moonlight Embrace wrote:
Thanks. I can do that :). Is the history in another table, or is it just pulled from the old table?
History is pulled from the old table, so anything you remove will just... disappear. :)
If you want to record all revisions but just remove the _text_ to save space, you might do something like this:
UPDATE old SET old_text='(This revision has expired.)' WHERE old_timestamp < '20040401120000';
or such.
-- brion vibber (brion @ pobox.com)
Thank you !
However there is a problem.
I 've followed your direction. But the old entries,which should disappear after having been deleted from the DB, are still displayed on the history page and when I click on the link, it displayed a page with the following text:
The database did not find the text of a page that it should have found, named "Terminology,oldid=334".
This is usually caused by following an outdated diff or history link to a page that has been deleted. <p>If this is not the case, you may have found a bug in the software. Please report this to an administrator, making note of the URL.
How can I fix this problem? Thanks!
Collin
-----Original Message----- From: mediawiki-l-bounces@Wikimedia.org [mailto:mediawiki-l-bounces@Wikimedia.org] On Behalf Of Brion Vibber Sent: Wednesday, August 18, 2004 4:37 AM To: MediaWiki announcements and site admin list Subject: Re: [Mediawiki-l] trimming the database
Moonlight Embrace wrote:
Is there a way to trim old versions of articles you know you don't need anymore?
You can manually remove old entries from the 'old' table in the database.
(Be very careful doing this; if you change your mind or mistype it cannot be undone without restoring a backup of your database!)
To delete all old entries older than noon UTC on April 1, 2004:
DELETE FROM old WHERE old_timestamp < '20040401120000';
To delete the older entries only from a specific article:
DELETE FROM old WHERE old_timestamp < '20040401120000' AND old_namespace=0 AND old_title='Some_article_name';
The timestamps are 14 digits: year, month, day, hour, minutes, seconds, and always stored in UTC (GMT) rather than local time.
This will not affect current article versions, which are stored in a separate table in the database.
-- brion vibber (brion @ pobox.com)
mediawiki-l@lists.wikimedia.org