Download a release ZIP archive from the CarrotCakeCMS download page and unzip the files into their own directory. Application guides can also be found on the download page.
Config file review
Always review the web.config in the downloaded bundle and compare it to the one in your site as there are occasionally minor changes to provide additional features or simply updates to .NET components (such as the assemblyBinding section).
There is also a global.asax if you are not already using one, just copy this out to your site. If you are already using one, review the contents of your global.asax and merge/incorporate the contents of the provided file.
NOTE: The download bundle includes a global.asax, merge the contents of this file with any you may have already created and if none exists, simply upload. Always do a quick compare between the config files in a download bundle and those on your site before overwriting the files.
Basic Site Configuration
Create a site in IIS or provision a new ASP.NET hosting account (with .NET 3.5 SP1 for webforms or .NET 4.5 for the MVC version) using your hosting provider's control panel, depending on your hosting arrangements. Neither the webforms nor MVC edition should be run as a sub folder/sub application, but should be the root content of its own IIS site instance. If you are using Server 2012 or later with the webforms edition, select a 4.0 app pool and modify the web.config for 2.0 compatibility.
Copy the files into your site's webroot. If this is an update, you should only need to upload the \bin\ and \c3-admin\ directory for webforms or \bin\, \assets\, and \views\ for MVC, other folders are (mostly) optional if updating, and configuration files should be compared against your hosted versions to confirm that you are running the most current configuration parameters.
Create a new database on your server, or contact your hosting provider to perform the operation. If you are limited to a finite number of databases in your hosting environment, you can share the same database and users across multiple sites. Be sure that each unique site its own unique SiteID value set in the web.config.
Your new site's GUID goes in the web.config to replace the GUID entry for SiteID in <Config SiteID=""/> (in versions before 4.3 this was formerly an <appSettings /> key CarrotSiteID). If you are coming from an earlier version, you can comment out the old entry and copy the value into this property.
Users configured as Administrators can log into any site that shares the same database, while Editors must be mapped to individual sites for access purposes.
Update the database connection string entry in the web.config for CarrotwareCMSConnectionString to match your database credentials, your hosting provider may provide this string when they provision your database.
<connectionStrings> <add name="CarrotwareCMSConnectionString" connectionString="Data Source=MyServer\MySQLInstance;Initial Catalog=CarrotCMS;Integrated Security=True;" providerName="System.Data.SqlClient"/> </connectionStrings>
<connectionStrings> <add name="CarrotwareCMSConnectionString" connectionString="Data Source=MyServer\MySQLInstance;Initial Catalog=CarrotCMS;User ID=MyDBUser;Password=MyP@ssw0rd;" providerName="System.Data.SqlClient"/> </connectionStrings>
Update the web.config section for <mailSettings> to reflect the network delivery settings appropriate for your ISP. You can leave the password field blank if you are not required to provide one or if your mail server has whitelisted your web server. This is important for password retrieval purposes. If this is not configured, if you forget your password, you will have no way to get a new password sent to you.
<system.net> <mailSettings> <smtp from="firstname.lastname@example.org" deliveryMethod="SpecifiedPickupDirectory"> <specifiedPickupDirectory pickupDirectoryLocation="C:\Temp"/> </smtp> </mailSettings> </system.net>
<system.net> <mailSettings> <smtp from="email@example.com" deliveryMethod="Network"> <network defaultCredentials="true" host="mail.example.com" userName="firstname.lastname@example.org" password="P@ssword1" /> </smtp> </mailSettings> </system.net>
Create the ID to identify your site. Run the SQL statement " select NEWID() as id " or you can use the Visual Studio "Create GUID" functionality, either is fine, it is just a matter of what is more convenient. A GUID is just a long hexadecimal string, so you can even edit the string and change some of the values around, just stay with the values A-F and 0-9. If you are coming from an earlier version (such as 4.2) you will need to migrate your web.config entries. Note the custom config section defined with <sectionGroup name="CarrotCakeCMS.Web" />
<CarrotCakeCMS.Web> <Settings> <Config SiteID="F9241444-92EB-487B-B2CA-6B83154C6F5B" /> </Settings> </CarrotCakeCMS.Web>
Paste the new GUID into the main web.config to replace the GUID entry for SiteID. If this is the first site with your database, you can leave the GUID that is preloaded in the web.config file as-is.
Alternately, comment out the web.config entry for SiteID, and open the file SiteMapping.config and add entries to map a set of domain names to different GUIDs. This will allow a single webroot to provide different content based on different domain names. This is similar to using different host headers or bindings in IIS for a single webroot.
<?xml version="1.0" encoding="utf-8" ?> <tbl> <sitedetail> <siteid>5D7A9FA5-3C52-4d0c-95BB-2F10FFBF7149</siteid> <domname>example.com</domname> </sitedetail> <sitedetail> <siteid>5D7A9FA5-3C52-4d0c-95BB-2F10FFBF7149</siteid> <domname>www.example.com</domname> </sitedetail> <sitedetail> <siteid>5016177C-4C7D-4F3F-A812-6BEB299C6DAB</siteid> <domname>othersite1.local</domname> </sitedetail> <sitedetail> <siteid>D0A2139E-B50E-4E68-98E0-DB6CB129FAF4</siteid> <domname>othersite2.local</domname> </sitedetail> </tbl>
Note: if www.example.com and example.com need to provide the same site, you will have to add entries for both, but they can point at the same GUID entry.
Upload the modified configuration file(s) to your website's webroot.
Configure the database
If your SQL credentials used in the web.config have dbo or higher rights, you can simply go to the logon page of the CMS and the tables will be created/updated for you. Before updating an existing site you should logout of the CMS administration. If you have no pre-existing users in the database, you will be prompted to create a new administrator once database updates are complete. You can create whatever username/password you wish. It is strongly recommended to let the system perform the auto update rather than manually release the database changes.
If you wish to manually deploy updates, or do not have sufficient rights from the credentials contained within the web.config, execute the ALTER*.sql scripts found in the source repository project "CMSDBUpdater". They are in numbered order, compare the commit date to the date of the release you are using to determine which script you should start with. In general, the scripts can safely be re-run, but if you run an older script, each script that came after must be run between it and the most recent in order to make the schemas match. The scripts provided were generated from SQL 2008 Express, they should also work on Standard 2008 or Standard 2008 R2, SQL 2012, etc. They may also work on SQL 2005, but have not been tested. Authentication is provided by SQL Membership Provider (Webforms) or ASP.NET OWIN (MVC).
CREATE 01.sql will create the application tables. Run this if you have no prior CarrotCakeCMS database. It also includes the SQL security provider schema and creates the security groups. You can just run this script and then go to the CMS logon page and create a new user.