Upgrade prepare_data script.