old_contents: from pmxbot import logging
  from pmxbot import util
  from pmxbot import rss
  from pmxbot import storage
  storage.migrate_all('sqlite:pmxbot.sqlite', 'mongodb://localhost')
  
new_contents: import importlib
  
  import pmxbot.storage
  
  def run():
  	# load the storage classes so the migration routine will find them.
  	for mod in ('pmxbot.logging', 'pmxbot.karma', 'pmxbot.quotes',
  			'pmxbot.rss'):
  		importlib.import_module(mod)
  	pmxbot.storage.migrate_all('sqlite:pmxbot.sqlite', 'mongodb://localhost')
  
  if __name__ == '__main__':
  	run()
  
subject: Update migration script so it only runs if executed as a script. Also updated module references.