This project is read-only.

Deploying Orchard via FTP

Topics: Installing Orchard
Nov 7, 2013 at 10:06 PM
Here is my situation... I have now built my first Orchard Web site (yah!) on my local development machine running Visual Studio 2012 and IIS Express. All is working nicely.

I now need to deploy the web site onto a production web server IIS 7.5. This is to a shared IIS 7.5 hosting environment which only support FTP.

From various posts and comments I have gathered that I could just FTP the whole site from dev to production, just stripping out the DLLs in the /Modules bin folders - but is this the best way? Is there any information on what files are actually needed at runtime? For example, I am assuming that the /Module .cs files are not needed either.

I did try running 'build Precompiled' from the VS command prompt as described here , but got a bunch of errors. I didn't pursue this as I wasn't sure if this was actually going to give me what I need.

I also tried packaging up the project from VS directly, but again, I don't think it gave me the complete file 'footprint' that I need to deploy.

Any advice on which route I should pursue would be appreciated.

Nov 8, 2013 at 2:37 PM
OK, after a bit of trial and error and a bit of research, I think I have discovered the elements you need to retain as part of the FTP process and those you can discard. To create a 'sliimed down' version of my local web site via FTP, I copied the whole project directory with the following exclusions:
and if you like a nice clean root folder...
I am sure that you could also remove some other files, but the above represents most of the mass of the project. For example, here are the before and after stats for my project:

Size: 1.73GB
No. Files: 7,273
No Folders: 1,729

Size: 59.4MB
No. Files: 3,955
No Folders: 1,324

If anyone feels there are files I should have included, or other files I could have easily excluded, then please let me know.
Nov 11, 2013 at 7:41 AM
build Precompiled is the way to go. What "bunch of errors" did you get when you tried?
Nov 11, 2013 at 8:50 AM
Edited Nov 11, 2013 at 9:56 AM
The errors, 17 in all, came at the end during the final Validate Project Files stage. All had the same general error messages:
"None" element name for include "Views\Script\TinyMceScript.cshtml" should be "Content"
These errors related to just the following projects and referenced various lines in each of the projects' .csproj file:
I tried editing the individual lines in each of the .csproj files, and repeated the build without error, but when I deployed the web site, I hit the following error:
Since I was short of time I decided to go for the strip out the unnecessary content which I could test more easily - sorry 'wimpy' I know.
Nov 11, 2013 at 1:48 PM
Edited Nov 11, 2013 at 3:51 PM
This is where I have got to...

I can 'build Precompiled' on a modified project. It seems that you have to do a full IIS Reset as opposed to an Application Pool or Web Site recycle (not sure how this would work on a shared hosting platform).
  • When I run the deployed build for the first time, I get the Orchard 'First Time' configuration screen.
  • If I copy the /App_Data and /Media folders from the development project, the 'First Time' configuration screen is not shown, but any modules or Themes that I have applied to the project appear to be missing.
I am now confused (which was what led me down the FTP route in the first place), as I can't find a way to use the build.cmd to create an instance of my modified project.

I could be that I have misunderstood the purpose of the build.cmd function. This is what I had expected:

1) Install, develop, enhance an Orchard Web Project using Visual Studio
2) At the end of the development, tidy up and compile for release
3) Run the build Precompiled command
4) Copy the results from the \build/Precompiled folder to the root of the production web application
5) Test - job done.

Is this incorrect?
Nov 12, 2013 at 1:02 AM
The "none" errors can be fixed by editing the relevant project file, yes. The authors of those modules missed a few things and should be notified, so they can fix their code for everyone else. You can fix it easily on your end, as you've found out, by opening the csproj files for each of those modules and changing the "none" attributes into "Content".

Can you give the stack trace for that new error?

No, you shouldn't have to reset IIS, recycling the app pool is enough even in precompiled mode.

If you are missing modules, it's probably because you didn't include them in the solution file, and so they were not included in the package.

You have perfectly understood the purpose of the build file, but your environment needs to take into account the changes you've made and the modules you've added...
Nov 12, 2013 at 11:49 AM
Thank you. I have to confess that the biggest problem here was my stupidity! I hadn't realised that modules added via the dashboard had to be manually included in the project to get them included in the build sequence - obvious when you think about it - but that was my problem - I didn't think!

I think that my problem was also a little exacerbated by choosing some older, perhaps unmaintained modules - I will pay more attention to the last updated dates in the future - I'm not being critical, I appreciate that these modules are created by clever, busy people, it's just at this stage of the leaning curve, its difficult to find the bandwidth for the unexpected. On the positive side of course, it does force you to use your brain!

For background, my introduction to Orchard was not ideal as it was via an unexpected project with tight delivery schedules. I would like to say that, apart from my own self-inflicted issues, how much I have enjoyed my introduction to Orchard. There can't be too much wrong with a CMS application that allows a first-time Orchard newbie to build a (more-or-less) production ready web site in just a couple of days (projections are a wonderful thing by the way!).

I am really excited about taking the time to get to know it better now the initial urgency has passed.
Nov 12, 2013 at 7:14 PM
Cool :)