Last modified: 2011-04-30 00:09:04 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.
(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.
(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.
(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".
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.
Created attachment 5909 [details] Patch against head
Created attachment 5913 [details] Special:Export a namespace, with a namespace selector against head A new patch, using the namespace selector widget.
Created attachment 5925 [details] Updating the release-notes. As instructed by ^demon.
Applied in r48349
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.
(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.
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.
Remove patch keyword until Brion's concerns have been addressed.
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.
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*