1. A method for automatically migrating servers into an environment of multiple firewalls, the method comprising: creating, by a computer, a graph representing the servers and connectivity, based on connectivity strengths and resource requirements; grouping, by the computer, the servers into multiple groups by using a graph based partitioning algorithm which considers the connectivity strengths and the resource requirements; creating, by the computer, first adjacency matrix and second adjacency matrix for the servers in a respective one of the multiple groups, wherein the first adjacency matrix is for local rules and the second adjacency matrix is for global rules; adding, by the computer, a respective one of endpoints to a local adjacency list, in response to determining that the respective one of the endpoints is in the respective one of the multiple groups; adding, by the computer, the respective one of the endpoints to a global adjacency list, in response to determining that the respective one of the endpoints is not in the respective one of the multiple groups; converting, by the computer, the local adjacency list and the global adjacency list to firewall rules for the respective one of the multiple groups; validating, by the computer, the firewall rules for the respective one of the multiple groups, prior to migrating the servers into the environment of the multiple firewalls; and applying, by the computer, the firewall rules to the respective one of the multiple groups, after migrating the servers into the environment of the multiple firewalls.