Update the site to the new orchard version
In the life cycle of the site, the new version of CMS is an important event. And the conversion should be simple. Unfortunately, orchard does not currently have an automatic upgrade mechanism. This topic will show you how to upgrade to a new version without any pains to ensure your data security.
One-sentence warning
No matter how you upgrade your website, you have to rewrite many files in this process. you are going to have to overwrite a lot of files in the process. this shoshould emphasize the requirement to backup first, but it shoshould also call your attention to any modifications you made to common files. for example, if you made any modifications to core modules and/or the framework (something you shouldn't do: custom modules and themes shoshould be used instead), you will loose them, or you will need to re-apply your changes after the upgrade. any modification you made to web. config or other common files will also need to be re-applied after the process.
If you made modifications to permissions on the files and folders inside your site, they may also get reset in the upgrade and need to be re-applied.
Update the running instance to the new version.
The following guidance applies only to individual Orchard web sites. If you are working in the source code orchard, please refer to the relevant section.
We strongly recommend that you back up a local site during the upgrade process.
- Back up everything on your site, including databases. This is especially important to ensure that the current running site can be rolled back no matter what happens during the migration process.
- Access the site settings page of your current instance (SettingsPages) record the current settings. This information is also not required during the migration process, but it is difficult to obtain this information if necessary.
- Access your current instanceModules/FeaturesPage andThemesPage to record all the modules and themes you have installed.
- Download the backup of the site from the server to your local computer. if you regularly back up data locally from the simulated environment to the released site to the production environment, data and media may have expired. Make sure you have downloaded it from the server.AppData _And MediaDirectory.
- If you are using the SQL Server Compact database, you have downloadedAppThe Data _ directory copies site Data. If your site uses SQL Server, you can copy the Data to the local Server to process the latest Data. However, this is not necessary for Migration. If you wan wants to use a local database, you also need to edit the seTtings.txtFile.Settings.txtThe file can beAppData \ Sites \ Default _ orAppData \ Sites \ [NameOfTheTenant.
- Install the latest orchard version in a new empty directory, but do not install it.
- Copy the original site'sMediaDirectory to the new site.
- Copy your original module and topic directory to a module or topic directory that does not exist in the new site.
- CopyAppData _ directory to the new site.
- Point to the Local web service to a new directory. You can use IIS. In this case, use IIS Manager to create a new web site pointing to a new directory. alternatively, you can use WebMatrix and IIS Express. To do this, right-click windows Resource Manager and chooseOpen as a Web Site with Microsoft WebMatrixThen run the site. Finally, you can use vs to open the site.
- Go into the dashboard. You're prompted to upgrade features. ClickModulesAnd upgrade each of the modules one by one until they are all up to date.
If you are upgrading from 1.0, the Recipes feature is disabled at this point, and unfortunately it can't be enabled from the admin UI. open an Orchard command-line and execute the following command:
Feature enable Orchard. Recipes
Alternatively, if you can't run the command-line, you can use the web command-line from the Experimental module. once the Web Command Line feature has been enabled, the web command-line can be navigated to by going to/Experimental/Commands. A third alternative is to unzip the following archive under a new Upgrade. from.1.0 folder under Modules: Upgrade.From.1.0.zip. enabling the Upgrade From 1.0 feature will enable the Recipes module. once this is done and you 've verified that Recipes are enabled, you can safely delete the upgrade. from.1.0 folder from Modules. * Go to the Orchard Gallery and get the latest version of all the modules you have on your site.
Publishing the Upgraded Site
You can deploy the locally upgraded site to your production server using your preferred deployment solution. that might be Visual Studio Web deployment, WebMatrix, or even FTP. you again have a choice of wiping out the target directory before you deploy. make your choice depending on your deployment method, how clean you want the resulting directory to be, and on how long it's acceptable to keep the site down.
As you deploy, make sure that the targetSettings.txtFiles aren't overwritten, so that the production site continues to point to the production database.
While you deploy, you might want to shut the site down by droppingAppOffline.htm _ file into the root. Remove that file once you're 'RE done.
Upgrading An Orchard Site In-Place
It is possible to upgrade a site in-place, if you can't or don't want to work with a local copy and then publish it. the procedure is less clean but it works.
- Backup everything (site and database ).
- Download the new version to your local machine.
- Add App_offline.htm to the root of the site during the upgrade. this variable tively tells the web server to return this page for all requests. you shoshould put a message such as "The site is currently being updated. thank you for your patience. please try again later. "in the file.
- Delete what's in bin. This ensures that old versions of binaries that won't get replaced will not continue to be picked up by the application.
- Delete the App_Data \ Dependencies folder. Orchard will rebuild this folder on startup. This ensures that old versions of module assemblies will not be picked up by the application.
- Extract the new version's zip file and copy what's in its Orchard folder over the server's Orchard web directory (answer yes to all prompts to overwrite ).
- Remove the app_offline file.
- The site shoshould be running now. Log-in and go into admin.
- Modules need to be updated. Do each of them.
If you are upgrading from 1.0, the Recipes feature is disabled at this point, and unfortunately it can't be enabled from the admin UI. open an Orchard command-line and execute the following command:
Feature enable Orchard. Recipes
Alternatively, if you can't run the command-line, you can use the web command-line from the Experimental module. once the Web Command Line feature has been enabled, the web command-line can be navigated to by going to/Experimental/Commands. A third alternative is to unzip the following archive under a new Upgrade. from.1.0 folder under Modules: Upgrade.From.1.0.zip. enabling the Upgrade From 1.0 feature will enable the Recipes module. once this is done and you 've verified that Recipes are enabled, you can safely delete the upgrade. from.1.0 folder from Modules.
You are done.
Upgrading an Azure Instance of Orchard
- You shoshould already have the full source code, with your modifications if you had any (additional modules or themes ). upgrade that by copying the source of the new version over it (overwrite whenever asked), or by doing a Mercurial update to the desired version. if you do not already have the full source code, then that means you don't have any changes to the default distribution. in that case just get the source code for the new version. in any case, at this point you shoshould have a local directory on your development machine that has the code for the new version, plus any themes and modules you may have added, and no data (be it media or database, as on Azure you are using blob storage for the former, and SQL Azure for the latter ). all that remains to be done is to build the new package and deploy it.
- Run clickToBuildAzurePackage. cmd. this file shoshould be at the root of your source code folder. if it's not there (it was missing from older release files), get it and other root files from the relevant version in http://orchard.codeplex.com/SourceControl/list/changesets
- Unzip artifacts/Azure/AzurePackage.zip
- Open ServiceConfiguration. cscfg and replace the value of the DataConnectionString with your defaendendpointsprotocol = https; AccountName = your-account-name; AccountKey = your-account-key
- Open the Azure Management Portal, go to Hosted Services, Storage Accounts & CDN and choose your deployment target. Click Upgrade.
- Browse to the package and config file, click OK.
- Log-in and go to admin.
- Upgrade features.
- If you are upgrading from 1.0, you need to enable the Recipes module. enable the Web Command Line feature. go to/experimental/commands and type "feature enable Orchard. recipes ". hit return. you may disable the web command line feature.
You're done.
If You Have a Source Code Enlistment
If you are working with a source code enlistment, the update process is going to be extremely simple because you are already going through it every time you sync your source code directory with the repository. when the time comes to upgrade, just get the latest changes and sync to the latest in the default branch.
Import/Export
The Import/Export module can be used to do clean data migrations from one version to another.
Applying a framework patch
Occasionally, we may release small updates in the form of a patch to one or several dlls. These patch files are regular zip files that contain updated dll files.
To install such a patch, first extract the zip, then make a copy of the version of those files that are already in the bin folder of your site. then, replace the existing copy with the one from the patch file.