Last modified: 2011-04-30 00:09:04 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T19886, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17886 - Export all pages from a custom namespace
Export all pages from a custom namespace
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
Export/Import (Other open bugs)
1.13.x
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-reviewed
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-09 15:04 UTC by David Tabachnikov
Modified: 2011-04-30 00:09 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Ability to export a whole namespace. (2.79 KB, patch)
2009-03-09 15:04 UTC, David Tabachnikov
Details
DB Wrappers for Special:Export by Tag and by Namespace functionality to use Database.php wrappers (2.74 KB, patch)
2009-03-10 17:10 UTC, David Tabachnikov
Details
Patch against head (3.58 KB, patch)
2009-03-10 19:05 UTC, David Tabachnikov
Details
Special:Export a namespace, with a namespace selector against head (3.55 KB, patch)
2009-03-11 07:25 UTC, David Tabachnikov
Details
Updating the release-notes. (4.81 KB, patch)
2009-03-12 13:00 UTC, David Tabachnikov
Details

Description David Tabachnikov 2009-03-09 15:04:08 UTC
Created attachment 5903 [details]
Ability to export a whole namespace.

I sometimes need to export all the pages from a custom namespace, to be able to transfer it to a different wiki. Attaching a tag to all the pages in a certain namespace didn't seem as the right way to do it.
Comment 1 Roan Kattouw 2009-03-09 19:13:57 UTC
(In reply to comment #0)
> Created an attachment (id=5903) [details]
> Ability to export a whole namespace.
> 
This patch uses a raw SQL query instead of using the Database.php wrappers, and doesn't limit its result in any way. Trying to export the main namespace on an enwiki-sized wiki would be a very expensive operation.
Comment 2 David Tabachnikov 2009-03-10 07:20:27 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > Created an attachment (id=5903) [details] [details]
> > Ability to export a whole namespace.
> > 
> This patch uses a raw SQL query instead of using the Database.php wrappers, and
> doesn't limit its result in any way. Trying to export the main namespace on an
> enwiki-sized wiki would be a very expensive operation.
> 

Hello Roan,

How is that different from the code in the function above it, that retrieves it by tag?
Where can I see the correct way to do it?

Thanks.
Comment 3 Roan Kattouw 2009-03-10 15:18:07 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > (In reply to comment #0)
> > > Created an attachment (id=5903) [details] [details] [details]
> > > Ability to export a whole namespace.
> > > 
> > This patch uses a raw SQL query instead of using the Database.php wrappers, and
> > doesn't limit its result in any way. Trying to export the main namespace on an
> > enwiki-sized wiki would be a very expensive operation.
> > 
> 
> Hello Roan,
> 
> How is that different from the code in the function above it, that retrieves it
> by tag?
It's not, probably, but that doesn't mean that's the right way to do it :)
There's still some hardcoded SQL left in the codebase.

> Where can I see the correct way to do it?
> 
Lots of examples all over the place, grep for "$dbr->select".
Comment 4 David Tabachnikov 2009-03-10 17:10:44 UTC
Created attachment 5908 [details]
DB Wrappers for  Special:Export by Tag and by Namespace functionality to use Database.php wrappers

Change for the Special:Export by Tag and by Namespace functionality to use Database.php wrappers.
Comment 5 David Tabachnikov 2009-03-10 19:05:14 UTC
Created attachment 5909 [details]
Patch against head
Comment 6 David Tabachnikov 2009-03-11 07:25:55 UTC
Created attachment 5913 [details]
Special:Export a namespace, with a namespace selector against head

A new patch, using the namespace selector widget.
Comment 7 David Tabachnikov 2009-03-12 13:00:38 UTC
Created attachment 5925 [details]
Updating the release-notes.

As instructed by ^demon.
Comment 8 Chad H. 2009-03-12 13:11:10 UTC
Applied in r48349
Comment 9 Brion Vibber 2009-03-18 02:57:20 UTC
Mmmm, this doesn't look very sensible... will clearly break on large wikis, and just looks kind of awkward for small ones. Maybe needs some revamp.
Comment 10 David Tabachnikov 2009-03-19 10:33:31 UTC
(In reply to comment #9)
> Mmmm, this doesn't look very sensible... will clearly break on large wikis, and
> just looks kind of awkward for small ones. Maybe needs some revamp.
> 

It's limited to 5000 results, so it won't break as such. It's a great way to transfer all the Templates from enwiki to a different wiki, or to transfer things between environments if you got smaller wikis, with different namespaces for different subjects.
Comment 11 Brion Vibber 2009-03-19 18:08:00 UTC
The 5000 limit is only apparent if you read the source code. The end-user won't know he's not getting everything, so he'll just get some surprise data loss.
Comment 12 Bryan Tong Minh 2009-11-12 22:27:32 UTC
Remove patch keyword until Brion's concerns have been addressed.
Comment 13 Vitaliy Filippov 2010-03-18 14:23:13 UTC
See also Bug 22881 - Greatly improved Export and Import for 1.14.1 (with support for advanced page selection, exporting and importing file uploads, and detection of "conflicts" during import). There's a patch written by me which is related to or fixes your issue.
Comment 14 p858snake 2011-04-30 00:09:04 UTC
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links