Modified migration to csv