Restoring a DotNetNuke Website

Restoring a DotNetNuke Website from a backup either to a new site or to a new install can be covered in a few easy steps.

I will assume that the action is taking place on the server, without a control panel interface.

I have restored backups where a website has been transferred for hosting, moved between servers, or as a result of a failed upgrade (I backup both the files and database prior to upgrading the version of DotNetNuke).

If you are moving a site the backup the database either through the control panel or direct on the management console for the database server. I save the files to a zip file – it keeps them together in a neat package and saves space.

To restore the files and database to an instance requires the existence of the site in IIS, a directory for the files and an initial database to have been created.

At the database management console select to restore the database (double check the chosen database, at this point its too easy to overwrite another database).

  1. Specify the source and location of backup sets to restore: click on the radio button for From Device and then click on the ellipse.
  2. Specify the Backup: click on Add and navigate to the database backup. It is expected that the file will end in .bak.
  3. Click on Ok to accept the file, and Ok again to confirm in the specify Backup window.
  4. Select the backup sets to restore: the chosen backup file will now be shown in this window
  5. Click on the checkbox against the backup set and then on the page menu at left select Options
  6. Select Overwrite the existing database
  7. Ensure that the two files specified, database and log file are of the correct name. Typically these will change according to the original source of the database.
  8. Click on OK and wait for the database to be restored
  9. In the Object Explorer right click on security and select New >> Login
  10. Enter a Login Name, select SQL server Authentication, enter a password (don’t forget to make note of it), select the password policy you wish to follow and then at the bottom select the database which the user is to be used against.
  11. Double click on the database in the Object Explorer and then right click on Security and add New User.
  12. In the Database User window enter the user name from step 10 in both of the first two textboxes, User name and Login name.. In the Database Role members select db_owner. Click on OK.

Having put the files in place edit the file web.config to reflect the database settings. Look in the file near the top for the lines:

 <connectionStrings>
<add name="SiteSqlServer" connectionString="Data Source=SQLServerReference;Initial Catalog=DatabaseName;User ID=WebsiteUserName;Password=WebsiteUserPassword" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="SiteSqlServer" value="Data Source=SQLServerReference;Initial Catalog=DatabaseName;User ID=WebsiteUserName;Password=WebsiteUserPassword" />

Change the values for

  • SQLServerReference
  • DatabaseName
  • WebsiteUserName
  • WebsiteUserPassword

To suit your configuration.

If all is configured correctly visiting the website should bring up the transferred site.

Often a failure to server the site is the result of incorrect references in the web.config file.

These are usually highlighted by looking at the Windows event log.