Rick Reszler

A Graffiti CMS powered site
  • rss
  • Home
  • Photos
  • Community
  • Contact
  • RSS

Xcopy Deployment Method

Rick Reszler 5/28/2008 10:09:00 PM

This is one of the greatest and most simplest tools\tips for upgrading or deploying site code which I use almost everyday.

Basically you are creating a new folder on the server and copying all the existing files and folders for your site to the new folder and the best part is this includes the permissions. Then all you do is re-point your site or virtual directory to the new folder and since the home directory path was set to new folder there is no need for an application pool recycle and you will never suffer the dreaded dll lock. Another great thing about this is you can roll back in a jiffy if needed which is really nice for that unexpected oops when deploying to production.

What I do is use the date for naming the folders which also makes it easy to remember when the site was last updated. So for example I  would use 052808 for updating a site today. Create a batch file called newfolder.bat with the following command: just edit the path to fit your needs.

  <xcopy C:\Sites\mywebsite\050808 C:\Sites\mywebsite\052808 /o /e /y /c /i

After running the batch file then deploy your updated site files to the new folder replacing any existing files and folders with the same name. More info can be found here in this kb.

Comments
1 Comment

1 responses.

Dan Hounshell avatar

Dan Hounshell says:

5.29.2008 at 1:13 PM

Rick, I notice that you (like a lot of other people) prefer to use dates on files/folders using a MMDDYY format. I'm all for dating files/folders too, for the same reasons that you mentioned above, but I prefer a different format. I always go with YYYYMMDD. Why?

Well if you end up having folders from several years and you start your names with MM then you lose some of the natural sorting ability that should come with using dates as folder names. They would be sorted by month instead of year. You might have a list that looks like this:

020307

021408

032407

030108

041507

043007

040208

It is a little more difficult to instantly see the "real" order. But if you used the year first format, it would look like this:

20070203

20070324

20070415

20070430

20080214

20080301

20080402

To me that is a lot easier to read - being sorted by year, then month, then day. Of course you could always just sort the folders by date, but to me using the year first allows for the "default" sort to work "correctly".

Great post, BTW. I'm going to have to start looking at using xcopy. You know that I use this same technique quite a bit, creating a new folder and then changing IIS to point to it. But messing up/losing the right permissions and resetting them has always been a pain. This is a great tip.

  • Popular Posts

    • Rob Howard sets the record straight on Graffiti-vs-WordPress
    • Graffiti Themes
    • Retired Apache for Blackberry Pearl
    • One Year Anniversary Telligent FTE
    • Graffiti CMS 1.0 Released
  • Random Thoughts

    • @dfwdraco76 yea and I still may end up reloading it, grrrrrr!
    • @dfwdraco76 what's up with that? :-D
    • OMG Sierra Nevada Torpedo. YUM!!!
    • Follow Me on Twitter
  • Categories

    • GraffitiCMS
    • Personal
    • Technology
    • Wizards Space
  • Hosting Infrastructure:
    IIS7 & SQL2008
Powered by Graffiti CMS
  • design by jide
  • Theme converted to GraffitiCMS by Adonis Bitar