Upgrade from 1.8 to 1.8.1 - Rebuild Solution

Topics: Administration, Core, General, Installing Orchard
Jul 8, 2014 at 8:56 PM
Edited Jul 8, 2014 at 8:59 PM
Hi,
A few months ago I set full source code enlistment of the Orchard version 1.8 using Git Extensions. Now I decided to upgrade to the 1.8.1. So in Git Extensions I clicked to the Pull and then in the new window I clicked again to the Pull without changing the following default settings:

Pull from
Remote: origin

Branch
Local branch: master
Remote branch:

Merge options: Merge remote branch into current branch
Tag options: Follow tagopt, if note specified, fetch tags reachable from remote HEAD



When I signed up, I saw in dashboard that I still have version 1.8.0.0. So I decide to that I probably have to rebuild whole solution.

So in Visual Studio I clicked to Menu -> Build -> Rebuild Solution and now I can see 1.8.1.0 in the dashboard.

Now I want to continue so I will remove all files on the production server except “Media” and “App_Data” and I will copy all files from the local server (except “Media” and “App_Data”).

Is this the correct procedure please?

On a production server I already have a functional site so I do not want anything to go wrong. Of course I will do backup but because I am not a developer I do not fully understand whether I am doing things correctly.

Thank you very much.

Borek Michal
Jul 15, 2014 at 11:18 AM
I also would like to know whether this is correct procedure:
  1. Git Extensions - Pull without changing default settings
  2. Visual Studio - Rebuild solution
  3. Replace all data on the production server except Media and App_Data folders
Can someone please answer this?

Maybe you do not have to Rebuild solution because that could be done by dynamic compilation.
Jul 30, 2014 at 6:52 AM
Revil wrote:
  1. Git Extensions - Pull without changing default settings
  2. Visual Studio - Rebuild solution
  3. Replace all data on the production server except Media and App_Data folders
Could someone please reply (yes / no) if this is the right approach? I do not want to break something on the production server.
Jul 30, 2014 at 12:34 PM
After your pull has been done from 1.8.x, when you browse your local code with gitextensions, you should see the same commits as in codeplex.
If the is not the case, you made a mistake.
Developer
Aug 1, 2014 at 1:55 AM
Looks right to me. I would try this first on your dev machine though.
Aug 8, 2014 at 8:28 AM
I am sorry for the delay. I was on vacation.
Thank you very much the the reply. The most’m interested in parts two and three.
  1. Git Extensions – Pull without changing default settings
    1.1 This is OK.
  2. Visual Studio – Rebuild solution
    1.1 Do I have to?
  3. Replace all data on the production server except Media and App_Data folders
    1.1 Is it correct procedure?
Developer
Aug 8, 2014 at 7:11 PM
  1. OK
  2. Maybe not, but sometimes something holds on to an older version of an assembly - rebuilding fixes that (most of the times - sometimes I have to manually clean out the bin folders of certain modules). Strictly speaking you don't have to build at all using Visual Studio, since you would not be deploying its output - instead, you would use the "ClickToBuild.cmd" and deploy its output (make sure to configure "build.cmd" to use the desired build configuration. Precompiled is my favorite).
  3. Yes. I usually clean out the entire root (after backing up App_Data and Media and any other production-specific files that I might have) and then upload the output from ClickToBuild.cmd.
Aug 19, 2014 at 9:07 AM
Hi,
again sorry for the delay. I wanted to run a few tests and that took me some time.

Thank you very much for the tip to ClickToBuild.cmd. There is no mention about that on orchardproject.net and I did not notice that this script is included.

For my usage it is easier to copy whole solution and not just output because I am sitting on a very fast line between my office and the datacenter. It is easier because it is handy to have totally same data on the stage and also on the production server. I suppose the whole solution (not just output from ClickToBuild.cmd) will not cause any performance issues on the production server and the amount of data is not a problem for me.

sfmskywalker wrote:
most of the times - sometimes I have to manually clean out the bin folders of certain modules
That was interesting information for me. I tried to remove all "bin" folders (delete whole folders) except following folder that is already included in project:
src\Orchard.Azure\Orchard.Azure.CloudService\Orchard.Azure.WebContent\Bin
and then I built the solution in Visual Studio. All bin folders was successfully recreated. So maybe to prevent problems in the future it is not a bad idea to remove bin folders when a new Orchard version is released and I want to update files on the production server.

Thank you and have I nice day.
Coordinator
Aug 19, 2014 at 6:43 PM
Copying the full source might seem easier but the Precompiled switch will actually define the settings for production usage, like Release mode compilation, and disabling unnecessary File System Watcher.
Aug 20, 2014 at 1:34 PM
Thank you very much for your advices. I started searching information on compilation using msbuild and now I understand that it is important to use Precompiled / Release.

I was not sure how to configure build.cmd / ClickToBuild.cmd so I run following command:

"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" Orchard.proj /t:Precompiled /p:PrecompiledFolder=D:\Test

And it is working. MSBuild built the site to the D:\Test.

I got 10 warnings and 8 errors and the site looks a little bit different (I do not have these warnings and errors in Visual Studio) so now I will try to correct these problems and then I will use it on the production server.

Thank you.
Aug 21, 2014 at 10:30 AM
I resolved all errors and some of the warnings and I finished with a few following warnings:
warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.
I suppose this is acceptable…


Please can you tell me is it OK to use MSBuild.exe as I mentioned in the previous post or should I rather use build.cmd / ClickToBuild.cmd?
Thank you.
Developer
Aug 26, 2014 at 7:21 AM
Edited Aug 26, 2014 at 7:21 AM
What you could do is open the build.cmd file and change it as follows:
if "%~1"=="" build Precompiled
msbuild /t:%~1 Orchard.proj
Notice that I changed "Build" to "Precompiled".
"ClickToBuild.cmd" executes "build.cmd", so with this change in place, you can simply execute "ClickToBuild.cmd".
Aug 27, 2014 at 7:24 AM
Hi,
thank you very much for your reply.

I did the same modification as you noted but I was not able to run the ClickToBuild script because some error. Now I focused the error I solved it. I found that for any reason I have directory:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC
But I do not have Visual Studio 11. I installed only VS2013 (12).

I modified the ClickToBuild from:
if "%WindowsSdkDir%" neq "" goto build
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" goto initialize2k8on64Dev11
if exist "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" goto initialize2k8Dev11
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" goto initialize2k8on64Dev12
if exist "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" goto initialize2k8Dev12
echo "Unable to detect suitable environment. Build may not succeed."
goto build
to (I exchanged 11 and 12):
if "%WindowsSdkDir%" neq "" goto build
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" goto initialize2k8on64Dev12
if exist "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" goto initialize2k8Dev12
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" goto initialize2k8on64Dev11
if exist "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" goto initialize2k8Dev11
echo "Unable to detect suitable environment. Build may not succeed."
goto build
And now it is working. Thank you.

Are the "different versions" conflict warnings important? Do I have to try to solve it?
warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.
Thank you.
Developer
Aug 28, 2014 at 5:49 AM
Thanks for sharing your findings, this might be helpful to others who might run into the same issue.

I don't know about the conflict warnings, but I simply ignore them - until they bite. ;)