You are on page 1of 6

Restoring or Moving a DNN Installation (From backup files) This tutorial is a followup to my DNN backup tutorial.

This document will discus s how you can restore your DNN site from your database .bak file and your DotNet Nuke .zip file. This could be to either restore a damaged DNN installation or to move a DNN installation to a new server. Below we will discuss the implementati on to restore the database, validate user accounts, restore DotNetNuke files, co nfigure a new virtual directory, and setup the web.config. Restoring the Database This step is the first part of the process as you must know how to access to the database to complete the DotNetNuke Restore. Restoring To SQL Server 2000 If you are using SQL Server 2000 you will want to use the below steps, please se e the SQL Server 2005 steps for restoring to SQL Server 2005 using SQL Server Ma nagement Studio Express. The first step is to create a new blank database with the same name as your exis ting database. To do this simply right click on your server and select "Create D atabase" providing the database name Right-click on your new SQL Server database Select "All Tasks" -> "Restore Database" Select "From Device" as the "Restore:" option Click "Select Devices" then "Add" Click the "..." button to browse for your .bak file, then press "Ok" to add it t o the list Click "Ok" to get back to the "Restore Database" window, then switch to the "Opt ions" tab Ensure that the "Force Restore over Existing Database" checkbox is selected Click the "Ok" button to begin the restore process Once completed you should receive a message stating restore successful! If you have restored this to a different database server, or to a different data base name be sure to follow the optional Web.Config change instructions below, o therwise you will not be able to access your database Restoring to SQL Server 2005 If you are using SQL Server 2005 you may use the below steps to restore your dat abase backup to the server. The first step to successfully restoring a database is to create a new database on your server. This is accomplished by right clicking on the "Databases" item i n SQL Server Management Studio Express (SSMSE) and selecting "New Database" If possible the database name that you create should be the same as the one you are restoring, but it is not required Now that you have a database right-click on it and select "Tasks" -> "Restore" > "Database" Select "From Device" as the source Click the "..." button, then click "Add" in the window that appears Find your .bak file then press "Ok" twice to return to the restore database wind ow Now you will see a list of backup sets to restore, select the MOST recent backup by placing a check box in the "restore" column. Now switch to the "options" page (upper left of the window) Ensure that the "Overwrite the Existing Database" is checked Ensure that the "Restore As" column indicates the proper .mdf and .ldf locations for your specific server. If needed you may change these using the "..." button s. (Typically needed for restores provided by a hosting company to a non-hosting company location). Press "Ok" to restore your backup

This should now have your database up and running on the new server. REMEMBER: i f you changed your database server name, or your database name from your previou s configuration you will need to follow the optional web.config changes listed b elow. Restoring the DotNetNuke Installation Follow the below steps to restore your DotNetNuke Installation, these instructio ns are assuming restoring to a new server that has NOT been configured to host y our DotNetNuke site. Using windows explorer navigate to c:\inetpub\wwwroot, then right click and sele ct "New" -> "Folder" and create a folder with the same name as your existing DNN installation. (If you installed to a different location you may simply navigate to that path and substitute it for any further path references) Open your DotNetNuke backup zip file Select "Extract All Files/Folders" For the extraction location select the new folder created in step 1 (OPTIONAL) If in the database restore process above you changed your server or d atabase name, you will need to modify your web.config file to note the changes. (See this tutorial for assistance) Creating New Virtual Directory (If Needed) If you are restoring your application to the same folder on your working product ion server, you should now have a fully restored copy of your site. If you are m oving to a different server or have restored to a path on the same server that d oes not have a virtual directory configured you will need to follow the below st eps. Open the IIS Snap-In tool, this can be found via "Start" -> "Settings" -> "Contr ol Panel" -> "Administrative Tools" -> "Internet Information Services" Expand the root nodes until you can expand the "Default Web Site" node You should see your newly created folder listed with a standard folder icon Right-click on the folder and choose "Properties" On the first tab click "Create" next to the application name. The application na me displayed should be the same as your previous installation. IF NOT you will n eed to modify the "Portal Alias" table to update to the new application name Now, switch to the "Documents" tab. Remove all current default documents and add in default.aspx Now, switch to the "Directory Security" tab Click "Edit" in the "Anonymous Access and Authentication Control" area Ensure that a checkmark is placed in the "Anonymous Access" option at the top of the window and press "Ok" to exit Now switch to the "ASP.NET" tab and ensure that "2.0.50727" is selected for the ASP.NET version Click "Ok" to save your changes and complete IIS Setup If you did not change your application name you should now be able to view your application. If you have specified a different application name, you will need t o modify any entries in the PortalAlias table that reference your old applicatio n name. This should provide you a quick guide to restoring or moving a DNN insta llation to a new server. Please let me know if you have any questions/comments/c oncerns. My forum is also available for anyone that would like assistance with a ny errors that might come up.

If you're upgrading your DotNetNuke instance, here is a list of simple steps to follow during the upgrade process. First tip, test the upgrade on a staging site first, pull a copy of the database and files down, try the upgrade, make sure all your functionality is still ther

e. Then upgrade production (backup everything first)

Here s the steps to upgrade

1. 2. 3.

Backup the database. Backup the file system. Make sure you did 1 & 2

4. Extract the latest DNN ZIP file somewhere, i usually use the installati on package, not the upgrade package out of preference. 5. Edit the web.config file from DNN package

a. Modify the SQL connection strings, there are two places, you can get th e string from your original web.config b. Be sure to copy the Machinekey ValidationKey and Decription key values f rom your original web.config file c. Double check the DatabaseOwner and ObjectQualifier values in the web.co nfig file, if you changed them in your original web.config file you ll need to cha nge them in the new one. d. Make any other changes to the new web.config that you added to the origi nal config file, anything your custom modules required? codeSubDirectories node perhaps? 6. Copy the new files, including the changed web.config file, over the old files. 7. Load the website, this will cause the upgrade to begin when the page lo ads. Make sure the upgrade process completes successfully. 8. At this point you should be done.

Like I said, test first, just to be sure you have everything working properly. Hope these steps help, I've upgraded many a DNN website, and even a few today.

A Newbie s Guide to Installing DotNetNuke Posted on Mon Sep 10, 2007 by Mary Veranis In: DotNetNuke, DNN Tips & Tricks 72 Comments Welcome to my first contribution to the Seablick Consulting blog! When Tom Kraak first asked me to write a how-to style blog post, I was thinking to myself, what c

an I offer in regards to DotNetNuke? I m a newbie! Then I began to realize how much I have learned in a very short amount of time. I also realized that I am lookin g at DNN from a different point of view than someone with years of experience. S o I may (and will) ask a lot of questions and I DO like feedback. One thing that I was very impressed with right from the beginning was the community s assistance and reassurance of my success. So for my first post, I decided to detail my exp erience of learning how to do a local DNN install. Installation is murky when you are new. As a developer, I like to know what is g oing on, where it s going on and who it s going on with. At first, I didn t understand how the database fit into the architecture of a DNN site. Once I had a clean inst all up and running, I was able to go into SQL Server Management Studio (or the l ike) and actually look at the tables, select on them and see what the install ha d created. That s when I began to get a bigger picture of how DNN works. My local setup consists of a Windows XP Pro machine running IIS 6, SQL Server 20 05, and the .NET 2.0 Framework. There are 5 basic steps to a clean install. I will cover each individually in mo re detail below. Download the .zip file from dotnetnuke.com. Create the database and a SQL Server login Create the website folder and unzip the downloaded .zip file. Create virtual directory in IIS and configure the website Run the DNN install wizard in your favorite web browser. 1. Download the .zip file from dotnetnuke.com. After you have logged into dotnetnuke.com, navigate to Downloads , select the desir ed file and save to your C: drive (for our example, I selected and downloaded th e 4.5.3 INSTALL (DotNetNuke_04_05_03_Install.zip.) 2. Create the Database, SQL Server Login, and Database User There are two things you need to do in SQL Server Management Studio. First, crea te a database. Second, create the SQL Server login for that very same database. Make sure that your database server runs in mixed authentication mode (SQL Server and Windows Authentication mode is checked.) You can find this setting by right-c licking on your server (first node in the SQL Server Management Studio tree on t he left), then Properties Security. Create the Database Open SQL Server Management Studio Select your desired server from the drop-down list and connect Expand the tree on the left-hand side so you can see Databases Right-click on "Databases" Select New Database In the "Database Name" field enter a name for your database and click OK. For th is example, I entered DNN453 You now have an empty database called DNN453 Creating a login for your database: Expand the Security node of your server Right-click on Logins Select New Login Enter your desired login name. You must remember this login name and password as we will use it later. For my purposes here, I ve entered DNN453Login (without the q uotes) as my login name. Select SQL Server Authentication and enter a password. I entered test as my password

. Uncheck Enforce Password expiration/User must change password at next login Click User Mapping on the left Select/Check the new database you created in the top grid Users mapped to this lo gin: Select/Check db_owner in the bottom list Database role membership for: Click OK Now look in the Security node under your database (DNN453) and you will see a ne wly created database user listed, meaning we also created a new database user by mapping our SQL Server login to our database. The database portion is now complete. Create the site folder and unzip the downloaded .zip file. In this step, we create a folder and unzip the DNN install .zip file to this dir ectory. You can put it directly under C:\inetpub\wwwroot or C:\foldername. For t his example, I used C:\DNN453. In Windows Explorer, create a new folder called DNN453 on your C: drive. This wi ll be the folder where your website files will live. Extract (unzip) the DotNetNuke_04_05_03_Install.zip file that you downloaded ear lier into your desired folder (C:\DNN453 in our example) After extraction is complete, the folder contains a web.config file that needs t o be modified. Remember how I stated in the beginning that DotNetNuke and the da tabase fit together? We must now tell DotNetNuke which database our website is usi ng. We do this in the web.config file. The default web.config file even gives us samples of connection string entries so that we only need to modify these based o n our database setup. Open the web.config file and find the <connectionStrings> tag. You can use Notep ad, Visual Studio or any other text editor to accomplish this. There you see two entries of connection string statements one for SQL Server Express and one for SQL Server 2005. By default, DNN uses SQL Server Express. The connection string for SQL Server 2005 is commented out. For our example (we are using SQL Server 2 005), we must reverse this and comment out the SQL Server Express statement and u ncomment the SQL Server 2005 statement. After that, we need to enter the correct values for server, database, uid and pwd according to the database we set up abo ve. In the below screenshot, XP1234 is my machine/my local SQL Server (please no te, if you are using server instances, it is entered as: XP1234\MYINSTANCE where MYINSTANCE is the name of the SQL Server instance). DNN453 is the database name (as specified in step 2.) Enter "DNN453Login" and test for uid and pwd, respectiv ely. We must also modify the key for the SiteSqlServer under the <appSettings> tag. Aga in, SQL Server Express is the default, with SQL Server 2005 commented out. We mu st comment out SQL Server Express and uncomment SQL Server 2005 and again, enter the correct values for server, database, uid and pwd for our database. Save and close the web.config file Lastly, you must change the access permissions of your folder. The Windows accou nt that is used to access your site must have full control over your DNN root fo lder. To set this, right-click on the root folder of your site (C:\DNN453). Clic k Sharing and Security. Click the Security tab. If you do not see the Security t ab, you must turn off simple file sharing for the folder. To do this, select the r oot folder (C:\DNN453) in Windows Explorer. Click Tools Folder Options. Select the View tab. Uncheck Use simple file sharing. Click OK. You can now right-click the folder and access the Security tab. On the Security tab, you will see a list of users who have access to your folder . Windows XP uses the ASPNET account and Windows 2003 uses the NETWORK SERVICE a ccount. Add the account and give it full control permissions. 4. IIS create virtual directory and set-up Now that the database and file system are in place, we can create the virtual di

rectory in IIS. Open IIS and expand the tree to see Default Web Site . (You can find IIS in Start Control Panel Administrative Tools.) Expand the "Default Web Site" node. If you have placed your DNN root folder under C:\inetpub\wwwroot, you will alrea dy see your website and can bypass this step. If not, you will need to add a vir tual directory. Right-click on "Default Web Site" Click New Virtual Directory Enter an alias "DNN453" will do Click Next and enter/browse to the path to the root folder of your website. Click Next and leave access permissions as is (should be set to Read/Run Scripts .) Click Next and Finish Now that a virtual directory is in place, you ll need to modify its properties. Click on the "Documents" tab An entry for default.aspx needs to be added. Add default.aspx and move it to the t op of the default documents list. Click on the "Directory Security" tab In the Anonymous access and authentication control group box, click "Edit" Make sure that Anonymous Access is checked as well as Integrated Windows authentica tion Next, click on the "ASP.NET" tab and make sure that 2.0.50727 is select for the AS P.NET version Click OK to save your changes 5. Run the DNN install wizard in your favorite web browser to complete the insta llation process. The very last step is to initiate the DNN install via a web browser. The install wizard takes over. In doing so, it creates tables and stored procedures in your database and adds the needed data rows to these tables to house your site. You will be prompted to test your folder s permissions, test the database connection a nd lastly, enter your desired user name and password for your host and admin use r. Write these down! Open your web browser of choice and navigate to http://localhost/DNN453 (replace DNN453 with the name of your IIS virtual directory) You will be guided through an install wizard. Test your folder permissions when requested. Verify your database connection when asked. You will see the wizard running the script for each version. On successful completion, click on Access your Portal and your new DNN-based websi te appears. I hope that this tutorial offers DNN newcomers a better understanding of the Dot NetNuke installation process on Windows XP Pro and SQL Server 2005. Lastly, I would like to thank Tom for giving me this opportunity and for his pat ience and guidance. I m hoping for a bright future with DNN. Did I miss something or got something wrong? If so, I want to hear about it. Ple ase leave your comments below as feedback is much appreciated!

You might also like