With the release of Umbraco 4.6 (Juno), users now have the option of using Microsoft’s new embedded database engine, SQL CE 4. This means that you don’t need to depend on using a database server (such as SQL Server [Express] or MySQL), you can run Umbraco exclusively from the file-system!
Also recently released is IIS Express 7.5, (another Microsoft web technology, as part of their WebMatrix framework), which offers a lightweight version of IIS – aimed at developers as a replacement for the Cassini web-server. One of the major features of IIS Express are that it can be launched straight from disk – it does not need to be registered/configured on the operating-system/machine.
Now, this got me thinking… Would it be possible to run Umbraco from a USB drive? Well, guess what?
#umbraco 4.6.1 + IIS Express 7.5 + SQL CE 4 + USB key = Success!
— Lee Kelleher (@leekelleher) January 14, 2011
Best of all its very very easy to do… here’s how:
- Download and install IIS Express 7.5 and SQL CE 4 – the quickest and easiest way is to install WebMatrix.
- Download Umbraco 4.6.1 (latest version at the time of writing) and also the “SQLCE4Umbraco.dll” assembly.
- Copy the following to your USB drive:
- Extract the Umbraco zip file, rename the “build” folder to something else – like “wwwroot”, then copy that to the USB.
- Copy over the “SQLCE4Umbraco.dll” into the “wwwroot\bin” directory.
- Copy the “IIS Express” directory (typically found at “C:\Program Files (x86)\IIS Express”) to the USB.
- Copy the SQL CE 4 binaries (typically found at “C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0\Private”) – also copy the “amd64” and “x86” sub-directories – to the “wwwroot\bin” on the USB drive.
- Once everything is in place, you should have 2 root directories, “IIS Express” and “wwwroot”.
- Open up a command prompt, run the following command:
"E:\IIS Express\iisexpress.exe" /path:E:\wwwroot /port:8080
- Open a new web-browser window, go to “http://localhost:8080”.
- If everything went to plan, the command prompt will display an output of all incoming requests.
- Back in the web-browser window, you should be prompted with the Umbraco installer wizard. If not, something went wrong! :-(
- Remember to used the SQL CE 4 database engine!!! (otherwise it wont be portable)
Once I had successfully installed Umbraco, I tried out a few packages; e.g. uComponents, set up an MNTP data-type, which worked as expected! Great!
After that I removed the USB drive; booted up my old laptop (Windows XP SP3) to see if it would still work. First try it failed! I didn’t have .NET 4.0 framework installed. Once I installed it, re-ran the command prompt – portable Umbraco worked as expected!
One point to raise is that I did notice slower performance of the Umbraco back-office – which doesn’t surprise me – since I was using a fairly old USB drive, but still the lag wasn’t enough to be overly concerned about.
Personally I see the portability of Umbraco to be very useful for client/customer demos/meetings… for any Umbraco developers who want to showcase their favourite CMS, now there is no excuse not to have a working copy in your pocket!