Enterprises are increasingly moving their IT infrastructures to the Cloud, driven by the promise of low-cost access to ready-to-use, elastic resources. Given the heterogeneous and dynamic nature of enterprise IT environments, a rapid and accurate discovery of complex infrastructure dependencies at the application, middleware, and network level is key to a successful migration to the Cloud. Existing migration approaches typically replicate source resources and configurations on the target site, making it challenging to optimize the resource usage (for reduced cost with same or better performance) or cloud-fit configuration (no misconfiguration) after migration. The responsibility of reconfiguring the target environment after migration is often left to the users, who, as a result, fail to reap the benefits of reduced cost and improved performance in the Cloud. In this paper we propose a method that automatically computes optimized target resources and identifies configurations given discovered source properties and dependencies of machines, while prioritizing performance in the target environment. From our analysis, we could reduce service costs by 60.1%, and found four types of misconfigurations from real enterprise datasets, affecting up to 81.8% of a data center's servers.