Back to all posts

Restoring or Moving a DNN Installation (From backup files)

Posted on Mar 11, 2007

Posted in category:
Development
DNN

This tutorial is a followup to my DNN backup tutorial. This document will discuss how you can restore your DNN site from your database .bak file and your DotNetNuke .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 implementation to restore the database, validate user accounts, restore DotNetNuke files, configure a new virtual directory, and set up 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 see the SQL Server 2005 steps for restoring to SQL Server 2005 using SQL Server Management Studio Express.

  1. The first step is to create a new blank database with the same name as your existing database. To do this simply right click on your server and select "Create Database" providing the database name
  2. Right-click on your new SQL Server database
  3. Select "All Tasks" -> "Restore Database"
  4. Select "From Device" as the "Restore:" option
  5. Click "Select Devices" then "Add"
  6. Click the "..." button to browse for your .bak file, then press "Ok" to add it to the list
  7. Click "Ok" to get back to the "Restore Database" window, then switch to the "Options" tab
  8. Ensure that the "Force Restore over Existing Database" checkbox is selected
  9. Click the "Ok" button to begin the restore process
  10. Once completed you should receive a message stating restore successful!

If you have restored this to a different database server, or to a different database name be sure to follow the optional Web.Config change instructions below, otherwise you will not be able to access your database

Restoring to SQL Server 2005 or later

If you are using SQL Server 2005 or later you may use the below steps to restore your database 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 in 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 window
  • 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 "..." buttons. (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: if you changed your database server name, or your database name from your previous configuration you will need to follow the optional web.config changes listed below.

Restoring the DotNetNuke Installation

Follow the below steps to restore your DotNetNuke Installation, these instructions are assuming restoring to a new server that has NOT been configured to host your DotNetNuke site.

  1. Using windows explorer navigate to c:\inetpub\wwwroot, then right click and select "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)
  2. Open your DotNetNuke backup zip file
  3. Select "Extract All Files/Folders"
  4. For the extraction location select the new folder created in step 1
  5. (OPTIONAL) If in the database restore process above you changed your server or database 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 production server, you should now have a fully restored copy of your site. If you are moving to a different server or have restored to a path on the same server that does not have a virtual directory configured you will need to follow the below steps.

  1. Open the IIS Snap-In tool, this can be found via "Start" -> "Settings" -> "Control Panel" -> "Administrative Tools" -> "Internet Information Services"
  2. Expand the root nodes until you can expand the "Default Web Site" node
  3. You should see your newly created folder listed with a standard folder icon
  4. Right-click on the folder and choose "Properties"
  5. On the first tab click "Create" next to the application name. The application name displayed should be the same as your previous installation. IF NOT you will need to modify the "Portal Alias" table to update to the new application name
  6. Now, switch to the "Documents" tab. Remove all current default documents and add in default.aspx
  7. Now, switch to the "Directory Security" tab
  8. Click "Edit" in the "Anonymous Access and Authentication Control" area
  9. Ensure that a checkmark is placed in the "Anonymous Access" option at the top of the window and press "Ok" to exit
  10. Now switch to the "ASP.NET" tab and ensure that "2.0.50727" is selected for the ASP.NET version
  11. 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 to modify any entries in the PortalAlias table that reference your old application name. This should provide you a quick guide to restoring or moving a DNN installation to a new server. Please let me know if you have any questions/comments/concerns. My forum is also available for anyone that would like assistance with any errors that might come up.