Development and Production Systems with DotNetNuke 

Managing the development process using DotNetNuke as a development framework is something that many individuals ask about yet it is something that is not often discussed.  I thought I would take this time to discuss a few of the ins and outs od development with DotNetNuke and maintaining a development and production environment from my experience. Please remember that the following comments are my personal opinions and are no way affiliated or associated with the feelings of DotNetNuke Corporation.

Traditional Methods?

Many people commonly ask "what can be done to keep my development and production environments in sync?".  This question is much harder than one might expect.  Traditionally a developer might say that you can simply copy all files and all database tables from one to the other and you are ok.  Well that isn't necessarily true with DotNetNuke, infact, it can be a very dangerout operation.  This is because DotNetNuke is a dynamic system and every time you input new information into the system auto increment fields are updated and if you make changes out of sync it can be devastating.  Therefore, it is my recommendation that if you do want to have a development environment that you routinely push to production that you treat your production environment as "read only" at least in terms of user accounts, modules, skins, pages, etc.  If you don't you run two risks; first of all you could overwrite data if the id's get out of sync, secondly you could have failed data copies if your are trying to insert new values.

Other Options?

Now I know a lot of you out there are most likely shocked by that news, but in reality this isn't just a thing with DotNetNuke, I personally see this with most applications out there, if you have active systems, you can just go dropping database overlays anywhere you want to.  I personally recomend taking a slightly different approach to development and that is the following.

First of al setup your development environment to look just like your production setup.  You will want the same look, feel, and modules to ensure that your testing processes will be valid.  One easy way to do this is to setup your inital site on your development environment and do the one time push to production, this will then deploy the look and you can start your development processes.

Secondly, in all development follow strict guidelines for module versioning and create SQL Data Providers for each individual database change you do.  If in a version of your module you modify 5 procedures, wrap it into a SQL Data Provider file, the same goes for any other number of database elements, just be sure to create 1 file for EACH version if you make database changes.  Doing this will allow you to use the automated DNN installation process.

Third, build .dnn manifests for all modules so you may use the "Host -> Module Definitions" page to upload new versionf of the module.  This goes along with the second point of following strict practices and versioning.  If you are setup with versions and strict DNN packages you can easily push updates to your sites by "installing" the new module version.

Now, I understand that this doesn't cover the migration of data between environments, therefore if you have a need to migrate data, foe example reporting data between environments.  Try to separate the data out into tables that do not utilize any DNN created id's, if you do this you can then run standard SQL Server DTS processes to move data between systems. 

Real-World Example

To try and pull all of this together I will explain how my environment is setup in my work environment and how I follow all of the above practices to maintain stable development and production systems.

A bit of background regarding the system that I manage.  Currently our system in on DotNetNuke 3.3.7 (Upgrading to 4.5.5 soon), the system is a reporting utilility that uses external data that is pulled into DotNetNuke for reporting.  This data is in no way tied to the DNN tables as it is external company information.  For this system the inital site was setup on a local machine and then deployed to the production site.  Since this time we have never pulled back a production database copy to development.  So we have a different set of users locally than we do on the production site.

Each module release is developed and fully tested on the local development environment.  This testing process includes the testing of the SQL Data Provider scripts to ensure that they are working properly.  When this new module is ready for production we take precautionary backups of the production system and then simply load the installation package via the "Host" menu on the site.  We can easily validate the upgrade logs as well as checking the version information displayed for each module.

We also have monthly reporting data loads that occur, for these items we simply use the SQL Server Import Data utility to pull in our data each month as were are managing tables that are ONLY used for our reporting purposes and are not tied to DotNetNuke.

Conclusion

How you manage your DotNetNuke development really depends on the specific types of applications/modules/products that you are creating.  However, I do believe that it is fairly safe to say that regardless of which method you use, it is NOT safe to simply copy dev to production unless you have a very specific business situation that dictates that it is something that can be managed.  Please share your comments/feedback below, this is simply a quick overview of my thoughts on the matter.

Posted by Mitchel on Thursday, September 06, 2007
 

Comments


Ok, can we just start with the "for-dummies" version and move up from there. Because I need deployment strategy for a site (at least at the start) that is probably a lot less demanding than yours. I have a module called OpenSmartModule that will allow me to create simple "modules" by just creating a usercontrol in ASP.net. .. thats my strategy for now, to avoid having to deal with deploying real DNN modules for the time being.

Updating modules you have written:
1. strict versioning
2. create SQL Data Providers for each individual database change you do.
3. build .dnn manifests for all modules

Im not exactly sure what items 2 and 3 mean, hopefully they will become evident when I eventually work on my first dnn module. Ive got 3 or 4 books on SQL here. I just checked, The only one that mentions custom data providers says "thankfully we wont be covering that in this book".

For starters I have a module called authintegrator that allows me to run ordinary ASP aps and have them authenticated by DNN. Ive edited the skin I will be using and turned it into a master page, so I can jump out to a similar looking ASP ap and then back into DNN. I also intend to cheat and use something called open-smart-module, which allows you to plug a web user control into it to deploy a simple module into DNN. I might also buy X-Mod, now that you can connect user-controls to it... the more I find out about DNN modules, the more I tend to think Ill stick with my cheating ways... shelling out to ASP.Net aps and using third party modules, keeping important data in my own simple tables.

Im guess-timating that your advice mostly kicks in around "level 4" below (am I correct?):

* Level 1:
Suppose you have a site with no user data stored, except the basic login info. Its a site withjust html modules and some installed third party modules. Suppose all you are doing is expanding the site, adding more html to the existing html modules, adding new modules, moving modules around, and changing the skin?

* Level 2:
Suppose, now, that you have a site with lots of user data in 3rd party modules. Lets say, for example you have a couple instances of X-Mod, and a gallery module (thats flat files and db files). And you want to do the same thing, move modules around, edit a skin.

* Level 3:
Then there is the case where you have created your own module(s). But they dont store any permanent user data in them, except that they read existing DNN tables.

* Level 4:
You have your own constructed module(s) that store user data in a totally separate table, using a duplicate of the userID.

* Level 5:
In addition to everything else, you have written your own module(s) and are keeping data both in DNN's tables and external tables.

By miamiray on Thursday, September 06, 2007 at 6:50 PM

Ray,

I would say that my recommendations are for users building their own custom modules, regardless of the type of data they are storing.

By mitchel.sellers@gmail.com on Thursday, September 06, 2007 at 7:20 PM
Click here to post a comment

Donate

Show your appreciation for the content/modules made available by MitchelSellers.com by making a donation. Donations are used to assist with dedicating time to creating free content.