More robust directory structure migration, should fix bug #2532, except for Brion...