Add rake task to migrate user profile and user preferences. Fix #818