| | | | | | | | | Mitchel Sellers' DotNetNuke, .NET, and Other Topics Blog |  |
| | | | Subscribe To Blog Updates by E-Mail
|
|
|
| | | | | | Restoring or Moving a DNN Installation (From backup files) By Mitchel Sellers on Saturday, March 10, 2007 @ 7:00 PM | | | |
4314 Views :: 24 Comments :: :: DotNetNuke, Tutorials
| | | | | 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. Restoring the DatabaseThis 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 2000If 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 2005If 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 InstallationFollow 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)
-
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
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. |
| | | | |
| | | | | | Share/Save This Article | | | | Use the below controls to save this article to one of many popular social bookmarking sites!
| | | | |
| | | | | | Article Comments | | | | By
y01nk @
Thursday, March 29, 2007 11:53 AM
|
Great step-by-step- worked like a charm for us when we got into a bind.
Thanks!
|
|
|
By
Steffen @
Friday, March 30, 2007 8:05 AM
| |
Both your backup and this restore guide are great. It's nice sometimes to be guided this detailed. I ran into problems however. I had a login that was not associated with the particular DNN db and this login was not backed up and restored. My user for the DNN db was backed-up and restored but as it relied on the login, it did not work. I had to delete the user and create a new login and a new user (with the same name) to get it to work.
|
|
|
By
Chris @
Friday, April 27, 2007 9:39 AM
|
We are following this tutorial, but getting the following error: Error Installing DotNetNuke Current Assembly Version: 04.03.07 ERROR: Could not connect to database specified in connectionString for SqlDataProvider
Any ideas?
|
|
|
By
Mitchel Sellers @
Friday, April 27, 2007 12:30 PM
| |
That error is most likely due to changed database connection information in the web.config. Ensure that your database name, server name, and username/password values are correct in the web.config for the new location.
|
|
|
By
John Sanders @
Monday, July 09, 2007 2:28 PM
| |
If the move/restore is on a new box - don't forget to install .NET redistributable and change ASP.NET to "Allowed" from the default of "Prohibited" in the "Web Service Extensions" page. -JS
|
|
|
By
Gagan @
Tuesday, October 23, 2007 8:13 AM
|
Hey... it's a nice guide, but the problem occurs when you transfer a domain which has been setup on localhost to Production Server.
Any Solution to that ?
|
|
|
By
Mitchel Sellers @
Tuesday, October 23, 2007 8:46 AM
|
Gagan,
Yes, you can simply add an entry to the PortalAlias table for your domain. Then restart the web application and it will work perfectly!
I am going to release an updated guide that includes the detail for this in the next week or two
|
|
|
By
Phil Edon @
Wednesday, November 14, 2007 12:00 AM
| |
Great info. Any advice on transfering from sql2003 to sql2005. Our IT has a new SQL2005 server and want me to move my sql2003 database accross.
|
|
|
By
Mitchel Sellers @
Wednesday, November 14, 2007 3:31 AM
|
Phil,
I assume that you are talking about going from SQL 2000 to 2005? This is actually a really easy migration, simply backup the database from 2000, then restore it to 2005 then simply update the connection string.
|
|
|
By
David @
Thursday, December 20, 2007 11:17 AM
| |
Thanks so much for this invaluable resource! It has been very helpful as we set up our DNN installations. Question: we are trying to create a duplicate site to run upgrades on before we try them on the main site (in case of crashes, etc). I've been following the instructions for moving an installation, and have followed all these steps, but i get an under construction page each time i navigate to the new site. Any ideas?
|
|
|
By
Mitchel Sellers @
Thursday, December 20, 2007 11:24 AM
|
David,
Ensure that you have a proper portal alias for the URL that you are moving the site to. (My updated guide from Nov. 2007 as this information).
Otherwise I would ensure that the database connection values (both of them) are correct for the restored database.
|
|
|
By
Dag @
Saturday, January 05, 2008 1:00 PM
|
Orphaned Users and Permit in Database Role This is a good guide! I moved a database from a SQL Server 2000 to SQL Server 2005. Not using the backup method but the Attach method. As fare as I have tested both methods will create Orphaned Users in SQl Server 2005. To Detect Orphaned Users I used the following commands: USE <database_name>; GO; sp_change_users_login @Action='Report'; GO; I the created the users in SQL 2005 and to Resolve an Orphaned User I used the following commands USE <database_name>; GO sp_change_users_login @Action='update_one', @UserNamePattern='<database_user>', @LoginName='<login_name>'; GO
Investigating the user rights after this process reviles the following:
- In SQL 2000 Standard, the regular DNN user has the following rights (SQL Server Enteprise Manager, Databases, dnn database, Users, dnn_user, properties : Public, db_owner, aspnet_Membership_FullAccess, aspnet_Profile_FullAcess, aspnet_Roles_FullAcess
- In SQL 2005 Standard, the regular DNN user has the following rights (Database role membership) aspnet_Membership_BasicAccess, aspnet_Membership_FullAccess, aspnet_Membership_ReportingAccess, aspnet_Profile_BasicAccess, aspnet_Profile_FullAccess, aspnet_Profile_ReportingAccess, aspnet_Roles_FullAccess, aspnet_Roles_ReportingAccess, db_owner Could you if possible elaborate on the change of user rights?
|
|
|
By
Dag @
Saturday, January 05, 2008 4:15 PM
|
It seems to necessary to change capability level fro SQL 2000 to SQL Server 2005 (90). Furthermore it apers to be something wrong with the database owner I get this error when clicking Database Diagrams: Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database owner to a valid login, then add the database diagram support objects. Apparently I can get around this by executing: USE <database_name>; GO; EXEC sp_changedbowner 'sa'; GO;
Can this be confirmed?
|
|
|
By
Dag @
Saturday, January 05, 2008 11:22 PM
|
An other issue has also arrived in that the prefix of the tables inside of the database has changed. Previously there were some files without prefix (SQL 2000) and some files with dnn_ prefix (SQL2000). In SQL 2005 this have change to dbo_ prfix for som asp files and dbo_dnn_ prefik for the rest of the lot. Will this change impact the web configfile for DotNetNuke?
|
|
|
By
Mitchel Sellers @
Sunday, January 06, 2008 6:25 AM
|
Dag,
Sorry for the delay in replying to your messages.
WOuld it be possible for you to move these items into my forum for a more detailed discussion?
You bring up a few very valid points, that can cause problems, it does appear that you have completed everything correctly.
|
|
|
By
Dag @
Monday, January 14, 2008 12:23 PM
| |
By
Rahul Singla @
Tuesday, April 08, 2008 12:00 AM
|
Great Guide!!! However, I am having problems. I backed up the database from a production Sql 2000 Server, & restored it on my localhost Sql 2005 Express server. All was fine till now...
Next, I backed up the DNN Files, unzipped them to localhost, changed the alias in Database & modified the web.config file for connection string. However, I get the following error, when opening DNN pages: "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
However, I have Named Pipes enabled on my local server. Please help!!!
|
|
|
By
Jim @
Tuesday, April 08, 2008 4:07 AM
| |
I am considering DNN for use at our company. What I am having trouble finding is an approach to support the usual corporate development cycle of building new functionality on a test box, moving to a staging area for client testing, and then a final push to production. The backing up and restoring the DNN database in full is an approach that would not work for that. Is there a blueprint for how to do a test, staging, production life-cycle with DNN? Any insight would be greatly appreciated.
|
|
|
By
Mitchel Sellers @
Tuesday, April 08, 2008 4:55 AM
|
Rahul,
Ensure that you allow remote connections in the Surface Area Configuration.
Jim,
I am not sure of a "blueprint" or document outlining this, but I just got done working with a company in a week long training session on DotNetNuke and gave them some information on how to do it. Drop me an e-mail at msellers@iowacomputergurus.com and I can try to get some information your way.
|
|
|
By
JM @
Tuesday, April 08, 2008 12:00 PM
|
Great guide, i just have 2 questions, 1 - why is needed the same directory name? is not configurable? and 2 - i also move my db from 2005 to 2000, i see the whole site but when i try to login as host it always tell me that the pass is incorrect.
Thank you
|
|
|
By
Mitchel Sellers @
Wednesday, April 09, 2008 3:35 AM
|
JM,
You can restore it to a different folder name typically without issue, just be sure to modify the alias properly if in a virtual directory solution.
Most likely you have an orphaned user with the migration, validate via enterprise manager that your user account is fully created.
|
|
|
By
JM @
Thursday, April 10, 2008 8:09 AM
|
Hi, thanks for your post. I am having some troubles with the users, because i dont have orphaned users at all, cause i publlish all with the microsoft publishing wizard, and i dont migrate the users. My specific question is, the DNN makes relations in a config file or config table with the DB Users (their GUID?). Maybe if you have some resources or experience with the user authentication routines of DNN you could tell me how to fix this.
Thanks
|
|
|
By
Mitchel Sellers @
Thursday, April 10, 2008 9:01 AM
|
SO you are able to connect to the database, but the users of DNN cannot login?
Can you please move this to my forum?
|
|
|
By
Rahul Singla @
Friday, April 18, 2008 8:22 AM
|
I found out the reason why the connection using Named pipes was not successful, and thought of posting the solution so that others do not face the same problem...
Simple!!! I did not had Sql Browser running on my machine... Just run the Sql Browser service, and there should not be any problem connecting to Sql Server via Named Pipes.
|
|
|
Click here to post a comment | | | | |
 | |
| | | | |
| | | | | | | | | Archive |  |
| | | | | | | | |
| | | | | | | | Categories |  |
| | | | | | | | |
| | | | | | | | Donate |  |
| | | | | | | | |
|