Hi,
I've been searching & frustrated for the better part of today - in doing what should be a fairly straightforward development process: Deploying my dev DNN site on my development box to a staging and a production server.
Here is what I am trying to achieve:
- Set up DNN 4.8.4 on my dev machine (W2003 server, SQL Server 2005 std, VS 2005)
- Set up DNN 4.8.4 on my staging server (W2003 server, SQL Server 2005 std)
- Set up DNN 4.8.4 on my production server (W2003 server, SQL Server 2005 std)
I feel that this is a fairly NORMAL development setup, at least for me and any software company that I've ever worked for. The idea is that I develop on the (ahem) development machine, when a build is ready, deploy it to the staging server (which has an identical environment to the production server), put the build through testing and when it passes, deploy to the live server. This is a NORMAL way to develop to me... development should not, except in emergencies, be done on the production environment.
First, kudos to whomever is responsible for the install application - it worked perfectly the four or five times I've used it on my dev box. Logical and efficient.
Now you will notice that the 3 environments that I have are all quite similar, in a vain hope to eliminate as many 'environemental difference' problems as possible.
There doesn't seem to be any f0rmal instructions for how to accomplish deployment from dev to staging or production. In the forum I find some posts that seem to think it's a bad idea to deploy. That you should package up your individual enhancements into modules so that you can, instead of deploying, sort of 'upgrade' the staging and production installs with your custom modules. Some posts recommend developing on the production server so that you don't have to deploy.
Now, in my hours of searching have I missed some documentation that outlines how to deploy? Ideally is there some sort of wizard that you can use from the site or host admin? I'm not holding my breath but the DNN framework is sometimes quite amazing with great features. Maybe I've missed that one.
If DNN doesn't have it, why not? I can see a need for users to be able to deploy individual portals, as well as the entire 'host'.
In any case, here is what I did to deploy to staging. It's probably quite a bodge, and I'm sure that there is an easier way to do it....
- Set up development environment using a SOURCE install.
- Install SOURCE modules for modules that you are going to want to view the code of, or hack around a bit.
- Set up your portal. Create pages. Develop custom modules. Alter existing modules to suit. Build a skin. etc
- Copy the contents of the 'website' directory (from the SOURCE DNN install) up to the production server, where you want it to eventually live. I usually use FTP to do this, (and a fantastic little tool: BeyondCompare - it's a developer 'must have' Diff tool).
- On the staging server, set up a website in IIS as per the instructions in the official DNN install .pdf
- Use SQL Server Management Studio to do a backup of your dev DB.
- copy the DB dump (backup) to the staging server.
- Use SQL Server Management Studio to 'restore' the dev DB into your Staging DB.
- Manualy add a new portal alias by entering new record in the PortalAlias table on the Staging DB.
And that's pretty much it. Except today I had the default portal come up and running fine, but the other portals didn't work, I kept getting the dreaded 'Under Construction' page when trying to browse to them. After mucho swearing I figured out that I could just go into IIS and add the alias' of the non-working portals to the 'host header' for the DNN website. I don't understand how DNN works it's magic, but I assume it's some sort of ISAPI binding mojo that intercepts incoming requests, and if there isn't a host-header match in IIS, looks into the DNN portal alias table and redirects.
Now that I have my dev and staging sites up and running, I don't have any problem modding files in dev and FTPing them up to the staging server. Any DB changes are a different thing: does anyone have a list of tables and even better, a script or module that allows updating the DNN from one DB to another? I'm thinking about cooking something up, but I'm sure to be missing stuff - and that will engender the dreaded DNN 'rot'!
summary
So, I just want to know the 'approved' deployment method to move code AND DB changes from one DNN install to another. Note point 3 above - I've hacked some of the standard code to get it to work the way that we need, most of the hacks would NOT lend themselves well to putting in modules, as they effect the core code.
Cheers, Lance