[11:07:24] Dear colleagues, I know about Revision deletion in MediaWiki. This function can hide an old revision. — Is there a function to delete an old revision? Completely delete so it disappears from database? Or, if not disappears, becomes invisible to anyone? — I speak of local MediaWiki installation so I may add any extension. Thank you. [11:31:46] I believe that's what [11:31:46] `maintenance/deleteArchivedRevisions.php` does [11:41:37] This removes only deleted pages. [11:42:02] Maybe this may also remove some old revisions? But how can I mark these revisions to be deleted? [11:42:34] If I hide some revisions, they stay hidden, not deleted... [11:48:15] You could probably delete it at the database level, but its a fairly un-recommended since relational database and all… [11:49:14] Well, this means to learn about database, and about SQL, and about requests... I hoped there's a tool for that... [12:28:51] deleteArchivedRevisions.php wipes *all* the deleted revisions from the database [12:29:41] The idea is, when we have a page with 12 revisions, to delete some of those revisions from history. Not to hide, but to make them non-existing. [12:30:05] How can I do this with deleteArchivedRevisions.php ? What must be done? [12:30:20] By deleted it means deleted revisions from deleted pages, not "hidden". The naming is a bit confusing since "revision deletion" exists in core [12:30:38] You can delete the page, and then restore all revisions except the ones you want to delete permanently [12:30:48] Then run this script [12:30:51] Wow. Let's check this! [12:31:01] All deleted pages will be unrecoverabe, though [12:32:10] Oh, I see what happened lol [12:32:10] https://mediawiki.org/wiki/Manual:DeleteRevision.php [12:32:10] This was the way to archive revisions but it got removed [12:32:46] And then you'd use `deleteArchivedRevisions.php` [12:35:36] Those scripts are spotty at best. See also T213478 [12:35:36] T213478: purgeRedundantText: Potential data loss - https://phabricator.wikimedia.org/T213478 [12:36:41] Wow, the way with deletion and restoring looks good. But there's some detail to check. Well, I delete 10 revisions and restore only 6 of them. So the 1st revision is deleted, is invisible to anyone, even for me. This is good. — On the other hand, the 1st revision disappeared, so if I search for my edits and check [v] only revisions that are [12:36:41] creations of the pages, I cannot see the revision of this deleted-and-restored page. [12:37:28] Is there a way to make the 1st restored revision to become a 1st revision that created a new page? [12:38:06] Is there a way to have such 1st restored revision to be listed in the list of "only new pages"? [12:38:45] With database access, anything should be possible. But if MediaWiki doesn't handle it "properly" for you when (un)deleting pages, then there's no clean way to do that [12:39:18] Also creating a page leaves a log entry under the page creation log, that will obviously become out of sync [12:41:01] It's clear for me now. Many thanks to Vulpix for the way to delete some old revisions. [13:45:11] Can revision ids be reused? [13:51:01] Oh and is it normal that Special:MobileDiff uses different ids than Special:Diff [14:17:20] not without probably a lot of completely unsupported finagling [14:17:54] revision IDs increase monotonically with time; reusing one would require something along the lines of resetting whatever counter is used to track the latest ID to the spot you wanted to reuse, then resetting it back [14:18:10] (assuming the software doesn't just get the highest used revision ID directly from the database and increment it by one for a new revision) [14:19:38] Hmm because `wgRevisionId` is `0` on a certain broken page [14:19:39] While `oldid=0` points to current revision of Main Page [14:20:10] Except it actually doesn't have that id [14:20:52] revision ID 0 I don't think is actually used by the software, so I'd expect trying to use it to result in something like "current revision of the main page" [14:22:42] So I guess wgRevisionId = 0 just means the actual revision is gone [14:23:58] Especially since it doesn't match `wgCurRevisionId` even though I should be on current revision [14:46:25] If it's relying on the internal auto_increment from the database, it can probably happen if you delete recently edited pages, backup the database, restore it again and then performing some edits. It may reuse the IDs from the deleted ones that aren't present on the table [14:48:21] Before mysql 8.0 the auto_increment was reset even after each server restart! https://bugs.mysql.com/bug.php?id=199 [15:05:20] preview also has revid = 0 if a remember correctly [15:08:23] Hmm it's not a revision though [15:08:23] https://en.touhouwiki.net/wiki/Template:%E4%B9%9D%E5%AE%9D%E6%99%82 [15:08:31] s/revision/preview/ [15:08:57] yeah its basically "does not exist" (a preview doesn't have a revision)