Ticket #2149: migration.patch

File migration.patch, 652 bytes (added by carrott, 14 years ago)
  • /

    old new  
    102102def _migrate_file(root_path, old_root_path, uid):
    103103    if os.path.exists(os.path.join(old_root_path, uid)):
    104104        new_data_path = layoutmanager.get_instance().get_data_path(uid)
    105         os.rename(os.path.join(old_root_path, uid),
     105        new_data_dir = os.path.dirname(new_data_path)
     106        if not os.path.exists(new_data_dir):
     107                os.makedirs(new_data_dir)
     108        os.rename(os.path.join(old_root_path, uid),
    106109                  new_data_path)
    107110
    108111