0

I use Visual Studio 2013's "Publish" and Web Deploy to publish my Asp.Net MVC 5 website. However when I update my website, it won't work during the upload. I'm looking for a way to minimize the downtime of the website during the update. The website is running in a VPS and I have full access to it. One solution that came to my mind is to configure the Web Deploy to first put the uploaded files to a temporary folder and once the upload is finished, it should then replace the new files. This would make the update a few seconds tops. I can do this manually but that's not an elegant way to update one's website.

PS: Maybe there are better ways to update the website but so far I like the web deploy. It's much faster than FTP for instance.

Alireza Noori
  • 14,961
  • 30
  • 95
  • 179

2 Answers2

0

One of the most interesting things I've seen is to have two websites. Only one of them is running at a time. After finishing the upload, you disable the active one, and enable the one you uploaded too.

This works well if both are in the same Application Pool and even works with sessions if you want (how to: Configure SQL Server to Store ASP.NET Session State).

I've never done it this way, seems a little to complex for the minimal down time there actually is, but it's one way.

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
0

Here's the solution that we use on a high traffic website with 4 web servers.

1) Files are moved to the server into /site/version-xxx 2) IIS Web Application is re-pointed to the new version.

All this is automated and synchronized across the web servers. The end user doesn't notice any difference. (we don't rely on sessions to persist the user experience, if sessions is a must for you and you don't want to interrupt them, then you need to consider to store them on an external system that will not flush them when the websites are repointed).

This approach also allows us to rollback to any previous version.

Roman Mik
  • 3,179
  • 3
  • 27
  • 49