Couple of things here: If you use `ModuleStore.get_modulestore_type`, I think you can handle this in such a way that it tries to import into mongo if possible (on a course-by-course basis), and if it can't import into mongo, then it can fall back to XML. In particular: if you're using an XMLModuleStore exclusively, then you'll always get `XML_MODULESTORE_TYPE`. If you're using mongo or mixed modulestores, then you might get `XML_MODULESTORE_TYPE`, you might get `MONGO_MODULESTORE_TYPE`, or you might get an error (if the course doesn't exist). If you get `XML_MODULESTORE_TYPE`, then the course either already exists as an xml course, or all courses are xml courses, in which case you should import as xml. Otherwise, you should just import as mongo (since we're trying to move away from xml-based courses, importing into mongo when you have a choice is the right default implementation).

Finally, since importing into xml isn't safe when running a multi-process/multi-host instance of edx-platform, can you hide behind a default-off feature flag, so that an administrator has to explicitly enable it (and that flag can have a comment about the dangers of enabling it in a multi-process system).