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 “wwwrootbin” 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 Editionv4.0Private”) - also copy the “amd64″ and “x86″ sub-directories - to the “wwwrootbin” 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 Expressiisexpress.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!
really interesting.
so i guess that also:
umbraco 4.6.1 + IIS Express 7.5 + SQL CE 4 + Azure = Success.
i know that there is better option for deploy umbraco to azure cloud, but this should work too, no?..)
Hi Eran,
I haven’t looked at any of the Azure services yet. I’m guessing you mean Windows Azure? Yes, I’m sure Umbraco would work well with SQL CE 4 on that platform.
Take a read over Morten Christensen’s blog posts about deploying Umbraco to Azure: http://blog.sitereactor.dk/2011/01/12/umbraco-on-azure-series-deploying-to-azure-with-accelerator/
Thanks, Lee.
thanks, i read that already.
if you want to take advantage of all the Azure cloud advantages, you should probably use also the SQL Azure DB, like in the Morten’s article, but the cons will be not so easy configuration (at least for now..).
with 4.6 and SQL-CE the deployment to the cloud will be really easy, and that’s great.
Awesome stuff Lee! So many exciting possibilities with this approach. Nicely done!
Brilliant!
Or, if you’ve got WebMatrix installed anyway… launch WebMatrix and select the ‘New site from folder’ option. Then point to the wwwroot folder on your usb drive. No need to create the IIS Express folder at all!
cheers,
doug.
Lee,
That is mint, great for client demos Umbraco the CMS in your pocket. Not many other CMS’s can make such a bold claim!!!
Ismaill
Pingback: Running Umbraco from a USB drive (via Lee Kelleher’s Weblog) « Dev Blog
Hi Lee,
Great article, next challenge for you it to get it running on an iPad
Ok, probably impossible, I can but dream
Seriously though, I think it is potentially very useful for client demos.
Cheers,
Chris
Excellent work Lee, This will be a great tool to give an Umbraco client demo a little wow-factor.
I am going to try to add a simple little ‘launcher’ app, to avoid having to manually run it from the command line. If I manage it I’ll come back over and share.
Thanks Barry. I thought about a launcher too… was also thinking that it could be done with an AutoRun.inf too?
You can make a .cmd (or .bat) file and just double-click it. Here’s my “start.cmd” file…
@echo off
"%CD%IIS Expressiisexpress.exe" /path:"%CD%wwwroot" /port:8080
cheers,
doug.
Awesome… now where is that “high-five” button?
#h5yr
This is great. I have been running a semi-portable Umbraco + VistaDB + Dropbox (+ Cassini on standby if no local webserver) for over a year, but the genius idea of adding IIS Express takes it to the next level
You. Rock.
Following on from Douglas’ solution, you can also use %~dp0 to get the path of the batch file – rather than the current directory you are in…
“%~dp0IIS Expressiisexpress.exe” /path:%~dp0wwwroot /port:8080
…then you can launch it from any directory!
Good tip Giles! I wasn’t aware of that variable. Cheers.
Another thing I’ve been doing a lot lately is using a custom Sent To script, as outlined here: http://blog.mattbrailsford.com/2011/03/14/easily-serve-any-folder-in-iis-express/