Page MenuHomePhabricator

[MCR] create maintenance script for Migration of text from archive table to text table
Closed, ResolvedPublic

Description

The table archive has a the old fields archive.ar_text/archive.ar_flags. Before removing that fields (T33223) a maintenance script is needed to move the text to the text table.

Calling Revision::newFromArchiveRow for each row with archive.ar_text_id IS NULL to extract the text with all flags.
But no idea how MediaWiki saves the text back to the right table and cleaning up the archive table, because we do not do undeletion (In that case Revision::insertOn does the work).


Version: 1.20.x
Severity: enhancement
See Also: T24624: Corruption of archive text due to deletion in late 2004

Details

Reference
bz34925

Event Timeline

bzimport raised the priority of this task from to Normal.
bzimport set Reference to bz34925.

pawanseerwani+bugzilla wrote:

I am willing to work on this. I am new to mediawiki, so can someone please explain me what is to be done here?

Pawan: Comment 0 explains what needs to be done here. If something *specific* is unclear, please ask specific questions after you have found the code and taken a look at it to understand it.

pawanseerwani+bugzilla wrote:

Code for migration of the fields archive.ar_text and archive.ar_flags from archive table to text table

Attached:

pawanseerwani+bugzilla wrote:

Comment on attachment 14409
Code for migration of the fields archive.ar_text and archive.ar_flags from archive table to text table

As I understand, the archive.ar_text and archive.ar_flags are to be migrated to text.old_text and text.old_flags

I have added the first version of patch for the migration.
Do comment on it.

Further questions :

  1. Should I delete the corresponding fields of the migrated entries from the archives table.

Edit :
I now realize that archive.ar_id should be migrated to text.old_id as well.I will do it in the next patch.

Hi Pawan! Thanks for your attachment! It's not a patch though but a code file.

You are welcome to use Developer access

https://www.mediawiki.org/wiki/Developer_access

to submit a patch as a Git branch directly into Gerrit:

https://www.mediawiki.org/wiki/Git/Tutorial

Putting your branch in Git makes it easier to review it quickly. If you don't want to set up Git/Gerrit, you can also use https://tools.wmflabs.org/gerrit-patch-uploader/
Thanks again! We appreciate your contribution.

Change 110503 had a related patch set uploaded by Gerrit Patch Uploader:
textMigration.php : Migration of text from archive table to text table

https://gerrit.wikimedia.org/r/110503

Assigning this bug to myself, as I was already working on it (and at least at the moment, have more complete code).

hashar removed PleaseStand as the assignee of this task.Nov 20 2015, 7:24 PM
hashar set Security to None.
demon removed a subscriber: demon.Mar 9 2017, 8:49 PM

Change 393928 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] Migrate ar_text to modern storage

https://gerrit.wikimedia.org/r/393928

CCicalese_WMF renamed this task from create maintenance script for Migration of text from archive table to text table to [MCR] create maintenance script for Migration of text from archive table to text table.Jan 9 2018, 2:14 AM

Change 393928 merged by jenkins-bot:
[mediawiki/core@master] Migrate ar_text to modern storage

https://gerrit.wikimedia.org/r/393928

Anomie closed this task as Resolved.Jan 10 2018, 4:47 PM

Maintenance script has been created, so closing this bug. If there's not already a task for actually running the script, I'll file one.