How to Restore a DNN Installation 

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.

  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

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.

  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. Right click on this new file and switch to the security tab.
  3. Add full permissions to the ASPNET account (Win 2000/XP) or NETWORK SERVICE (Win 2003/Vista)
  4. Click "Ok" to save your changes
  5. Open your DotNetNuke backup zip file
  6. Select "Extract All Files/Folders"
  7. For the extraction location select the new folder created in step 1
  8. (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

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.

Posted by Mitchel on Monday, November 19, 2007
 

Comments

Hello Mitchel,

Apart the fact that it was still very very difficult for me to find the correct connection string (in the past tutorials, I was not alone to have plenty of difficulties with the connection string, because many different possibilities to write the connection string exists...).

Apart this problem, when following:
==============================
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)
==============================

If I choose for example mydnn as a folder, and I connect to http://localhost/mydnn, my website is showing, excepted that ALL my images are not shown. I need to edit each module, to find the correct path for the images. And the path is modified from:
/Portals/0/images/myimage.gif to
/mydnn/Portals/0/images/myimage.gif

WHY ? Where is my mistake ???
I tried to re-do the tutorial 5 times, without success....

I give up.
DV

By Déclic Vidéo FX on Tuesday, November 20, 2007 at 4:40 AM

DV,

The connection string is always an issue, and I am not 100% sure how to make it better.

The images, that is an issue that is related to the way that DNN links to images, and there is no easy way around it. I should have made a note about it.

The only way is to setup the site as an actual website in IIS and not as a virtual directory.

By mitchel.sellers@gmail.com on Tuesday, November 20, 2007 at 4:47 AM

Yes. Throughout any open source or free online project that uses a DB source, the connection string is usually always the most difficult thing to nail down. This is normally only because installing a web site package is typically so straightforward. I have found that http://www.connectionstrings.com helps me out a lot.

By Will on Tuesday, November 20, 2007 at 6:33 AM

Will,

Yes, that is a great resource, I typically have that mentioned in all of my tutorials, but I left it out in this one, I'll update it to include the link

By mitchel.sellers@gmail.com on Tuesday, November 20, 2007 at 6:44 AM

Hello,

I have the connection string working perfectly. But I still have the problem with images, and there must be something wrong. I have also tried to install a fresh DNN 4.5.5 as well as 4.7.0 and I have the same problem. All my paths are "/mydnnfolder" relative.
If I look on my host settings, relative path for LIVE site is EMPTY. On my local installation (live to local or new install), I have a relative path /mydnnfolder
WHY ? How could I remove this ?

Thanks for your help,
DV

By Déclic Vidéo FX on Tuesday, November 20, 2007 at 9:37 AM

DV,

When on a local install, you will have that extra folder, it is a downside to doing a restore locally.

The ONLY way to fix it is to modify the links to include the folder name in it.

different modules use the /portals/ method to start a link, that goes to the root domain, which is fine on your production site but NOT fine on a local restore when you are in IIS and cannot setup another website.

By mitchel.sellers@gmail.com on Tuesday, November 20, 2007 at 9:44 AM

my host powerdnn.com does not give me any control to restore my .bak file to their server. i can back up the site but apparently there is no way to restore a bak file to the live web server. i thought this was a basic feature. i did all my work locally and now I cannot transfer my work to the server. is this normal?

By tim gapinski on Monday, December 10, 2007 at 3:35 PM

Tim,

Yes, I am sure that if you submit a support request to PowerDNN that they would attach/restore the database for you.

I don't know of many providers that actually allow you to dynamically restore backups.....(I know my hosting provider doesn't).

By mitchel.sellers@gmail.com on Monday, December 10, 2007 at 3:57 PM

Thank you very much! This worked perfectly for me. I was working directly on the server and using actual, not virtual, directories.

By Ed on Friday, January 04, 2008 at 9:08 PM

Hi

Many thanks for your great and resourceful page.

Only one problem for me, the site and dbs were moved from mydomain.com/myDNN to mydomain.com/myDNN2 but I notice that in the Portal Alias my new portal mydomain.com/DNN2 doesn't show the users and pages associated with mydomain/DNN. This means that the DNN default page is shown rather than my previous 30 pages etc..

Do I export the portal to a template then add portal by importing?

Thanks
Lea

By LeaUK on Tuesday, February 19, 2008 at 10:03 PM

You can simply add a new portal alias to the system. After you add the new portal you will need to force a restart of the worker process. You can do this by adding a space to a non critical portion of the web.config and saving the file.

By mitchel.sellers@gmail.com on Wednesday, February 20, 2008 at 4:49 AM

Hi Michael, I really appreciate your advice.

But this does not work. I created a new portal with the http address of the new domain - perhaps I shouldn't do this. Perhaps I need to attached an http alias on the default portal?

By LeaUK on Wednesday, February 20, 2008 at 10:09 PM

Login as Host and go to Host > Portals > EDIT PORTAL > Portal Aliases > Add New HTTP Alias

That's what I should have done, not create a new portal!!

I was confused between the terminology:

Portal Alias and http Alias.

So, backup the db again now with new http alias and restore to new domain. I'll give that a go!

By LeaUK on Wednesday, February 20, 2008 at 10:19 PM

I have installed dnn 5.01.00 over a 4.9.2 (using sql 200).
It didn't go too well (unable to select modules or skins).
I would like to rollback to 4.9.2, but would like to do it without losing data from this week (e.g. forum topics and a few pdf files).

Could I just re-deploy the dnn.zip file and not the revert back to the old database backup file to do this?
thanks,
Mark.

By mark richardson on Thursday, July 30, 2009 at 5:24 AM

Mark,

No, you must roll back the db as well.

A SQL Sync process could be used to pull across data, but it is NOT an easy process. (Granted easier with some SQL tools that are out there.)

By mitchel.sellers@gmail.com on Thursday, July 30, 2009 at 5:31 AM

hi,
My system crashed i have backup of DNN and Database backup(2005) no i have 2008 sql server express and i want to set it back on local how can do it.

By vinod on Wednesday, October 07, 2009 at 6:43 PM

You can follow the same process

By mitchel.sellers@gmail.com on Wednesday, October 07, 2009 at 6:45 PM

Instructions on how to restore files is only offered for SQL Server 2000 & SQL Server 2005. I have 2008 and right off the bat there seems to be a difference. Can I use SQL Server 2008 and do you know where I could find those instructions if so?

By Adam Thornburgh on Monday, August 23, 2010 at 6:18 PM

Adam,

The process should be VERY similar.

By mitchel.sellers@gmail.com on Tuesday, August 24, 2010 at 3:25 AM

Dear Mitchel,

I followed your steps. I restored the files and folders AND database successfully. I am not sure about this step"Creating New Virtual Directory" I am using Windows Server 2008 and it has IIS 7. I could not find all options exept default ducumnet which I set to default.aspx.
what I get is the skin without pages and i assume it is not connected to database yet.
Can you please tell me what do you think?
it's the link: http://tinyurl.com/2wa4zco

Regards
Nike

By Nike on Wednesday, August 25, 2010 at 9:24 PM
Click here to post a comment

Disclaimer