Page MenuHomePhabricator

Mass rename/move of pages?
Open, LowestPublic

Description

Revived from archive as there were no answers.

I am trying to use AWB for a Bengali wikisource. We have a large number of pages (200-300 at least, page1, page2...) that we want to move to different name with a specific subpage. This is easily achieved by simply Moving the page and putting name ( "Name/page1" , "Name/page2"....) in front of the existing page name. Is there any way to accomplish this task with AWB? If not, does anyone know of any other extensions or bots that could do this based on a list of pages?

Event Timeline

jayantanth raised the priority of this task from to High.
jayantanth updated the task description. (Show Details)
jayantanth updated the task description. (Show Details)
jayantanth set Security to None.

If you want dynamic control over a list and have admin rights AWB will
allow you to move your pages wherever without a redirect. It is still
one-by-one.

Pywikibot would probably do it more easily if you have your origins and
targets already mapped out. Maybe @Mpaa or I can assist with wikisource-bot
though that would mean redirects, unless your community approved temp
admin.

Mpaa added a comment.Nov 5 2015, 9:42 PM

@Billinghurst, you can move w/o redirects with pywikibot, if that is what you meant.

I have just missed to find out , https://phabricator.wikimedia.org/T100292 task quite similar. I have not use pywikipedia scripts (''movepages.py'' and ''pagerename.py''), but as per previous feedback , there is a problem in Unicode. So we wish to at AWB.

Reedy added a comment.Nov 6 2015, 2:57 PM

You could do it in a Custom Module if you're renaming based on some pattern...

In Bengali wikisource, I have to move the pages in following way... we have a book of poem called "Gitanjali" with 200 poems with a different name, like Poem1, Poem2.....and I have to move all poem to subpage as like "Gitanjali/Poem1", "Gitanjali/Poem2".......

As of now I am using AWB with move function for move mutiple page one by one. could you please create one module for me to use?

Reedy added a comment.Nov 6 2015, 4:32 PM

So, starting with a list of articles, you want to move them ALL from "current name" to "Gitanjali/current name"

Reedy added a comment.Nov 6 2015, 4:41 PM

Do you want to leave redirects behind?

Reedy added a comment.EditedNov 6 2015, 4:47 PM

Version 1...

public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
{
    Skip = true;
    Summary = "Moved page";
    Variables.MainForm.TheSession.Editor.SynchronousEditor.Move(ArticleTitle, "Gitanjali/" + ArticleTitle, Summary, true, false);

    return ArticleText;
}

It will move a page, with the associated talk page, leaving no redirect. AWB will then make like it's "skipping" the page.

I wonder if I can get AWB to behave better after moving a page...

Are you literally just moving the page? Or are you doing any AWB processing on it afterwards?

I note there is no error handling either

Thanks @Reedy for prompt coding. Lets try this code leaving no redirect.

Tried with first with skip option "Doesn't exist" its apend text "test" screenshot attached.

Reedy added a comment.EditedNov 6 2015, 6:06 PM

Did you paste the code into the custom module window, enable the module, and then compile it?

The default code is to prend test, so it sounds like you didn't replace the code, or, if you did, you didn't recompile it

So, after pasting it, press the "Make module" button up in the top right

Reedy added a comment.Nov 6 2015, 6:09 PM

Oh. I just updated the code too. I noticed an extra comma that shouldn't have been there

jayantanth added a comment.EditedNov 6 2015, 6:16 PM

Yes, Please look at screenshot{F2923177}

Thanks @Reedy now its works and move the pages to subpage as desire properly.

Reedy lowered the priority of this task from High to Lowest.Nov 15 2015, 8:38 PM

Hi @Reedy, we need another module for mass move for the following condition.....

We have few pages as like below....
Gitanjali/Poem1
Gitanjali/Poem2
Gitanjali/Poem3
.......

we need to move all pages as like below

Geetanjalee/Poem1
Geetanjalee/Poem2
Geetanjalee/Poem3
.......
Respectively...

Please make a module for that. Thank you in advance.

public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
{
    Skip = true;
    Summary = "Moved page";
    string newTitle = "Geetanjalee" + ArticleTitle.Substring(ArticleTitle.IndexOf('/'));
    Variables.MainForm.TheSession.Editor.SynchronousEditor.Move(ArticleTitle, newTitle, Summary, true, false);

    return ArticleText;
}

I believe that should do what you want...

Hi @Reedy, its works nicely. Thank you again.

Mpaa removed a subscriber: Mpaa.Dec 14 2015, 9:12 PM

Hi @Reedy, I need move hundreds of pages on ur.wiki with leaving redirect. And these pages come from different categroies. Will you please make such module which takes page names from text file?

Reguyla moved this task from Make list to Interface on the AutoWikiBrowser board.