When one imports a XML dump from other wiki, and it contains pages in custom namespaces, if those custom namespaces doesn't exist on the target wiki, it will end in pages imported in the main namespace (with the original namespace in the title, but not without being in that namespace, since it doesn't exist). That can be confusing, and if a lot of pages are being imported with that problem, it would be a pain to fix the issue.
It would be good to add some validation when importing the dump, based on the list of namespaces already present on the header of the dump: If a page in the dump is in a namespace not present in the target wiki, abort the import.
Things we should consider:
- Adding a checkbox in Special:Import, and an option in importDump.php to ignore namespace validation: When marked, it should generate a warning at the end, but proceed with the import of such pages. Otherwise, abort the import when a page of a not-existing namespace is found.
- Don't validate the list of namespaces that are in the header of the dump, just when each page is being imported. For example, the original wiki may have custom namespaces not present in the target wiki, but the dump only contains known namespaces (eg: namespace 0), in this case it shouldn't abort the import "early".
A nice addition would be to allow mapping namespaces from the dump to other namespaces on the target wiki (bug 41969)