FS#48603 - {wiki} Recover lost deleted revisions

Attached to Project: Arch Linux
Opened by Dario Giovannetti (kynikos) - Wednesday, 16 March 2016, 07:50 GMT
Last edited by Jonathan Roemer (pid1) - Friday, 09 September 2016, 12:54 GMT
Task Type Bug Report
Category Web Sites
Status Closed
Assigned To Pierre Schmitz (Pierre)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 6
Private No

Details

Around the 30-31 January 2016, as a consequence of the measures taken against a spam attack wave, the ArchWiki lost around 40,000 (forty thousand) deleted revisions, which represent roughly 10% of the total number of revisions, historical evidence of the work of probably hundreds of users during the last 10 years.

We admins are partly at fault because we were considering them to be in a safe place: since we were able to browse them, deleting an article for us was like moving it to the trash bin.

Most of those revisions can however be easily restored from the most recent database backup before that date.

Here are the scripts to restore the revisions. I have tested them thoroughly in my local wiki installation, and they're very simple: they only take some rows from 2 tables in the backup database and insert them into the current database. These rows surely don't exist in the current database, so nothing is messed up. No other updates are required.

There are some values that however have to be updated in the scripts because they aren't opensourced:

A) we need to change the database name in both the .sh and the .sql scripts: I have guessed 'ArchWiki' for the moment;
B) I have guessed that the database tables don't have a special prefix; if they do, the .sql script must be updated accordingly;
C) in the .sh script I have assumed that the database dump from where the old revisions will be restored is called "archwiki_backup_before_restoring_purged_revisions.sql": of course we will have to change it.

Once the scripts have the correct values, the restoring procedure is as follows:

1) Lock the wiki with $wgReadOnly (as usually done);
2) Backup the current database (as usually done);
3) Download the attached .sh and .sql scripts in the same folder on the server;
4) Execute the './archwiki_restore_purged_revisions.sh' script on the server;
5) Backup the database again;
6) Test that everything is working normally;
7) Unlock the wiki.

After this we will proceed with undeleting all the good restored revisions with the help of a bot, and properly archive them according to our current safe procedure.

I'm setting high severity on this issue because the longer we wait, the more likely it is that the MediaWiki database structure will change after an update, and the scripts will have to be adapted and retested.

Thank you
This task depends upon

Closed by  Jonathan Roemer (pid1)
Friday, 09 September 2016, 12:54 GMT
Reason for closing:  Won't implement
Additional comments about closing:  Revisions are lost.
Comment by Dario Giovannetti (kynikos) - Saturday, 18 June 2016, 10:18 GMT
Our MediaWiki installation was upgraded to version 1.26.3: I've just done the same on my local installation, retested the patch and I confirm that it still works for me.

Loading...