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 setup the web.config. This is my second revision to the article.
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.
- 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
- 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 to the list
- Click "Ok" to get back to the "Restore Database" window, then switch to the "Options" 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 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
If you are using SQL Server 2005 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.
- 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)
- Right click on this new file and switch to the security tab.
- Add full permissions to the ASPNET account (Win 2000/XP) or NETWORK SERVICE (Win 2003/Vista)
- Click "Ok" to save your changes
- 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 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.
- Open the IIS Snap-In tool, this can be found via "Start" -> "Settings" -> "Control 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 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
- 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
You should now have a fully restored DotNetNuke site, if you are for some reason being re-directed back to a production site when taking a restore to a different server you must modify the PortalAlias table to include an alias for your current location. After adding this portal alias you must restart your application. The best way to do this is to modify the web.config by adding a space to a comment then saving it.
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.