AI-based legacy system migration