My websites were ranking in the first page for various keywords but during server migration I misconfigured the DNS settings and my websites become unavailable. I took nearly 72 hours to fix it.Now two of my websites are not receiving as much traffic as they used to get before the migration.The issue has been resolved yesterday but still webmasters tools shows Server Connectivity error.As you can see, due to this my website visits has been reduced drastically.Two of my sites were migrated with the same sites on the same server. Even though they show sever connectivity error, they were not affected by the migration.How long will it take for the websites to get ranked to their previous rankings or have they lost their rankings permanently and I have to do all the hard working again to bring them to their original rankings? 
How long Google takes to restore Rankings after resolving website down during server migration?
seo;google search;google ranking
No one can really say how long it will take specifically. You said your site was unavailable, but did not mention the exact nature of the unavailability.It depends upon what Google was seeing during that period. If the server was unavailable or you were getting 404 errors, then I rather suspect your recovery will be quicker. This is because Google understands accidents happen from time to time and in effect, puts your site on-hold until the situation is corrected.If your site is truly unavailable, then it is just a matter of Google realizing your site is back. Google will treat your server availability with some caution for a period until it feels comfortable. During this period, Google will push your site down in the SERPs. Once recovered, your site will begin moving back up.If your site was pointing to another web space and Google was seeing 404 errors, then it will simply take time before those pages begin to perform well again. When Google gets a 404 for any particular page, that page gets pushed down in the SERPs until it reappears. Google retries pages with 404 errors for a period and once the page reappears, it will begin to move the page back up in the SERPs.Google uses some caution to keep their SERPs clean of bad links.It has been my experience that recovery for 404 errors can be just a matter of a couple of weeks.I have experienced a couple of outages over the past years. One was fairly short, one day or less, the other as long as a week. (I chose to leave the site down while I was working on a security issue.)My short outage began recovering rather quickly and my site was performing well in the SERPs within a week or two.My longer outage took much longer. It was about 6 months before my site recovered to pre-outage performance.