How to move a DotNetNuke installation to another server
Last Post 03/18/2011 3:41 PM by Joseph Craig. 18 Replies.
Author Messages
SCMAO
Nuke Ace
Nuke Ace
Posts:56


--
03/13/2011 9:19 PM  
Please somebody help me, and write down all the steps, because something I am missing obviously, I still get the Installation Wizard every time.
I have a DotNetNuke site running on a development server on Win 2003 Server R2 Std SP2 with IIS6 and the database is SQL Server Express 2008 R2 (using mdf file)
I would like to move to another server, which is also Win 2003 Server Standard R2 (SP2), IIS6, and the database server is a separate server, Win 2008 Server R2 (with SP1), with a SQL Server 2008 Standard (not R2, I guess R1)

First I tried a new installation on the new server (connected to the SQL Std database server) with same database name - everything was fine, I could log in to the website.
I created a backup of the DotNetNuke database from SQL Express and restored on the new SQL 2008 Standard server on top of the new installation. (I had to do a SQL script based backup, because the new server was R1 and couldn't restore the R2 backup, but everything was fin this way.)
Copied over the files under wwwroot to the new server, same location, except the web.config file.
Compared the development site web.config file with the new installation one and copied over only sections which refer to new module installations (used a file compare tool called Beyond Compare)

I also tried to execute this command on new SQL server:
exec sp_change_users_login 'Auto_Fix', 'username'
found from this forum:
http://www.dotnetnuke.com/tabid/795...fault.aspx

I have read somewhere about the machineKey tag in web.config. What should be the machineKey, should it be kept the same as the new installation, or copied over from development machine?

Also how many connection strings should be there in web.config? I see 2 under connectionStrings tag and other 2 under appSettings tag, but the second one under each of those tags seem to be pointing to the local machine.

Please help me to figure out this.

Thank you,
Steven
SCMAO
Nuke Ace
Nuke Ace
Posts:56


--
03/13/2011 9:32 PM  
> Also how many connection strings should be there in web.config? I see 2 under connectionStrings tag and other 2 under appSettings tag, but the second one under each of those tags seem to be pointing to the local machine.

Sorry, I realized that the second lines were commented out, so only 1 line under connectionStrings and 1 under appSettings and they seem to have the correct values (and they are from the new installation, so the database was created with those successfully)
SCMAO
Nuke Ace
Nuke Ace
Posts:56


--
03/14/2011 11:31 PM  
Anybody has the steps for moving DNN to another server?
What triggers the Installation Wizard?
Which machineKey should I keep?
Joseph Craig
DNN MVP
Posts:11667


--
03/15/2011 6:28 PM  
Yes, there are some nice tutorials here on moving a site from live to "localhost" and back again. There's no reason that you can't move from live to another site the same way.

Basically, you need to move the database and the entire website directory. You'll have to adjust connectionstrings in web.config for the new installation. If the new installation has a different URL, you'll need to modify your portalalias table, too.

You should NOT change the machineKey setting. That will break all of your passwords.

If you are getting the installation wizard, that probably means that you haven't got the new installation connecting to the database correctly. Look at the connectionstrings for that.

Usually, the installation wizard is triggered if the database connection fails. If you set autoinstall to false in web.config, you can turn off the automatic trigger. You'll then get a generic "site is not available" message.

Joe Craig, Patapsco Research Group
Complete DNN Support
Joseph Craig
DNN MVP
Posts:11667


--
03/15/2011 6:29 PM  
You SHOULD copy web.config, changing only the connection strings.

(There is stuff in web.config that is important and may have been changed from the default by your installation.)

Joe Craig, Patapsco Research Group
Complete DNN Support
WinXnet
Nuke Master
Nuke Master
Posts:156


--
03/16/2011 1:12 PM  
Make sure the folder has correct security permissions on it - also check ASP.NET and NetworkService permissions. If you copied the file, they may not have the permissions set up on this server.
http://www.winxnet.com Emerson Bruce - http://chayadigital.wordpress.com
SCMAO
Nuke Ace
Nuke Ace
Posts:56


--
03/17/2011 9:39 PM  
Thank you both.

Joseph, I couldn't find any "autoinstall" in web.config, but I found this instead, I thought you refer to this:
< add key="UseInstallWizard" value="true" / >
so I changed to false, but after I did the followings, the pages showed an installation starting right away (Installation Satus Report) and lots of errors, some lines showing success. This is what I did before accessing the website:
- I migrated the database (under same name, same SQL login and user associated, I checked the SQL user permissions and I could log in with that to SSMS)
- I copied over all the files under wwwroot, but the files on the destination server are under a subfolder because IIS runs multiple sites. I copied the connection string section back (only 2 lines) from a saved web.config which I used for a clean installation on the same production server using the same database server, so the connection strings should be correct. (I double-checked the server, username, password and they were fine)
- I also added NTFS permission (Modify) for "Network Service" user under the folder where the database files are sitting on database server. I checked also the dotnetnuke folder under wwwroot on production server (destination) and it already had "Network Service" added with Modify permission. I am using Win 2003 server for IIS and Win 2008 server R2 running the database (SQL 2008 R2). I couldn't find the ASP.NET user, I guess that's on anonther type of OS.
I am not sure if I added the permission for Network Service to the right folder, is that correct what I did?

Thank you,
Steven
SCMAO
Nuke Ace
Nuke Ace
Posts:56


--
03/17/2011 9:41 PM  
Sorry for this long post, but I want to send you here the page which came up right away after accessing the website (Installation Status Report)
I hope it will be helpful. Thank you.


Installing DotNetNuke
Version: 05.06.01



Installation Status Report
00:00:00.046 - Checking File and Folder permissions Success
00:00:00.125 - Installing Version: 05.00.00
00:00:00.156 - Executing Script: DotNetNuke.Schema.SqlDataProvider Error! (see DotNetNuke.Schema.log.resources for more information)
00:00:03.578 - Executing Script: DotNetNuke.Data.SqlDataProvider Error! (see DotNetNuke.Data.log.resources for more information)
00:00:04.078 - Installing MemberRole Provider:
00:00:04.078 - Executing Script: InstallCommon
00:00:04.515 - Executing Script: InstallMembership
00:00:05.062 - Executing Script: InstallProfile
00:00:05.312 - Executing Script: InstallRoles
00:00:05.843 - Upgrading to Version: 05.06.01
00:00:05.875 - Executing Script: 05.00.01.SqlDataProvider Error! (see 05.00.01.log.resources for more information)
00:00:06.546 - Executing Script: 05.01.00.SqlDataProvider Error! (see 05.01.00.log.resources for more information)
00:00:09.843 - Executing Script: 05.01.01.SqlDataProvider Error! (see 05.01.01.log.resources for more information)
00:00:10.171 - Executing Script: 05.01.02.SqlDataProvider Success
00:00:10.187 - Executing Script: 05.01.03.SqlDataProvider Success
00:00:10.296 - Executing Script: 05.01.04.SqlDataProvider Success
00:00:10.312 - Executing Script: 05.02.00.SqlDataProvider Error! (see 05.02.00.log.resources for more information)
00:00:10.937 - Executing Script: 05.02.01.SqlDataProvider Success
00:00:11.015 - Executing Script: 05.02.02.SqlDataProvider Success
00:00:11.046 - Executing Script: 05.02.03.SqlDataProvider Success
00:00:11.062 - Executing Script: 05.03.00.SqlDataProvider Error! (see 05.03.00.log.resources for more information)
00:00:12.015 - Executing Script: 05.03.01.SqlDataProvider Success
00:00:12.046 - Executing Script: 05.04.00.SqlDataProvider Error! (see 05.04.00.log.resources for more information)
00:00:12.468 - Executing Script: 05.04.01.SqlDataProvider Success
00:00:12.500 - Executing Script: 05.04.02.SqlDataProvider Success
00:00:12.562 - Executing Script: 05.04.03.SqlDataProvider Success
00:00:12.593 - Executing Script: 05.04.04.SqlDataProvider Success
00:00:12.609 - Executing Script: 05.05.00.SqlDataProvider Error! (see 05.05.00.log.resources for more information)
00:00:13.515 - Executing Script: 05.05.01.SqlDataProvider Success
00:00:13.578 - Executing Script: 05.06.00.SqlDataProvider Error! (see 05.06.00.log.resources for more information)
00:00:14.062 - Executing Script: 05.06.01.SqlDataProvider Success
00:00:14.156 - Executing Application Upgrades: 05.00.01 Success
00:00:14.406 - Executing Application Upgrades: 05.01.00 Error!
00:00:15.062 - Executing Application Upgrades: 05.01.01 Success
00:00:15.187 - Executing Application Upgrades: 05.01.02 Success
00:00:15.187 - Executing Application Upgrades: 05.01.03 Error!
00:00:15.968 - Executing Application Upgrades: 05.01.04 Success
00:00:15.968 - Executing Application Upgrades: 05.02.00 Error!
00:00:16.046 - Executing Application Upgrades: 05.02.01 Success
00:00:16.062 - Executing Application Upgrades: 05.02.02 Success
00:00:16.062 - Executing Application Upgrades: 05.02.03 Success
00:00:16.062 - Executing Application Upgrades: 05.03.00 Error!
00:00:16.093 - Executing Application Upgrades: 05.03.01 Success
00:00:16.093 - Executing Application Upgrades: 05.04.00 Error!
00:00:16.156 - Executing Application Upgrades: 05.04.01 Success
00:00:16.156 - Executing Application Upgrades: 05.04.02 Success
00:00:16.156 - Executing Application Upgrades: 05.04.03 Success
00:00:16.156 - Executing Application Upgrades: 05.04.04 Success
00:00:16.156 - Executing Application Upgrades: 05.05.00 Success
00:00:16.218 - Executing Application Upgrades: 05.05.01 Success
00:00:16.218 - Executing Application Upgrades: 05.06.00 Error!
00:00:16.234 - Executing Application Upgrades: 05.06.01 Success
00:00:16.234 - Cleaning Up Files: 05.00.01 Success
00:00:16.234 - Cleaning Up Files: 05.01.00 Success
00:00:16.234 - Cleaning Up Files: 05.01.01 Success
00:00:16.234 - Cleaning Up Files: 05.01.02 Success
00:00:16.234 - Cleaning Up Files: 05.01.03 Success
00:00:16.234 - Cleaning Up Files: 05.01.04 Success
00:00:16.234 - Cleaning Up Files: 05.02.00 Success
00:00:16.234 - Cleaning Up Files: 05.02.01 Success
00:00:16.234 - Cleaning Up Files: 05.02.02 Success
00:00:16.234 - Cleaning Up Files: 05.02.03 Success
00:00:16.234 - Cleaning Up Files: 05.03.00 Success
00:00:16.234 - Cleaning Up Files: 05.03.01 Success
00:00:16.234 - Cleaning Up Files: 05.04.00 Success
00:00:16.234 - Cleaning Up Files: 05.04.01 Success
00:00:16.250 - Cleaning Up Files: 05.04.02 Success
00:00:16.250 - Cleaning Up Files: 05.04.03 Success
00:00:16.250 - Cleaning Up Files: 05.04.04 Success
00:00:16.250 - Cleaning Up Files: 05.05.00 Success
00:00:16.250 - Cleaning Up Files: 05.05.01 Success
00:00:16.250 - Cleaning Up Files: 05.06.00 Success
00:00:16.250 - Cleaning Up Files: 05.06.01 Success
00:00:16.250 - Updating Config Files: 05.00.01 Success
00:00:16.250 - Updating Config Files: 05.01.00 Success
00:00:16.250 - Updating Config Files: 05.01.01 Success
00:00:16.250 - Updating Config Files: 05.01.02 Success
00:00:16.250 - Updating Config Files: 05.01.03 Success
00:00:16.250 - Updating Config Files: 05.01.04 Success
00:00:16.250 - Updating Config Files: 05.02.00 Success
00:00:16.250 - Updating Config Files: 05.02.01 Success
00:00:16.250 - Updating Config Files: 05.02.02 Success
00:00:16.250 - Updating Config Files: 05.02.03 Success
00:00:16.250 - Updating Config Files: 05.03.00 Success
00:00:16.250 - Updating Config Files: 05.03.01 Success
00:00:16.250 - Updating Config Files: 05.04.00 Success
00:00:16.250 - Updating Config Files: 05.04.01 Success
00:00:16.250 - Updating Config Files: 05.04.02 Success
00:00:16.250 - Updating Config Files: 05.04.03 Success
00:00:16.250 - Updating Config Files: 05.04.04 Success
00:00:16.250 - Updating Config Files: 05.05.00 Success
00:00:16.250 - Updating Config Files: 05.05.01 Success
00:00:16.250 - Updating Config Files: 05.06.00 Success
00:00:16.250 - Updating Config Files: 05.06.01 Success
00:00:16.250 - Performing General Upgrades
00:00:16.296 - Loading Host Settings:
00:00:16.562 - Configuring SuperUser:
00:00:16.750 - Synchronizing Host Files:
00:00:18.765 - Executing Additional Scripts:
00:00:18.765 - Installing Optional Modules:
00:00:18.765 - Installing Optional Skins:
00:00:18.765 - Installing Optional Containers:
00:00:18.765 - Installing Optional Languages:
00:00:18.781 - Installing Optional Providers:
00:00:18.781 - Installing Optional AuthSystems:
00:00:18.781 - Installing Optional Packages:
00:00:18.781 - Creating Portal: My Website
00:00:18.906 - Error: Error creating Profile Definitions at DotNetNuke.Entities.Portals.PortalController.CreatePortal(String PortalName, UserInfo objAdminUser, String Description, String KeyWords, String TemplatePath, String TemplateFile, String HomeDirectory, String PortalAlias, String ServerPath, String ChildPath, Boolean IsChildPortal) at DotNetNuke.Entities.Portals.PortalController.CreatePortal(String PortalName, String FirstName, String LastName, String Username, String Password, String Email, String Description, String KeyWords, String TemplatePath, String TemplateFile, String HomeDirectory, String PortalAlias, String ServerPath, String ChildPath, Boolean IsChildPortal) at DotNetNuke.Services.Upgrade.Upgrade.AddPortal(XmlNode node, Boolean status, Int32 indent)
00:00:18.906 - Portal failed to install:Error!

Installation Complete



Click Here To Access Your Portal
Joseph Craig
DNN MVP
Posts:11667


--
03/17/2011 9:53 PM  
I was trying to refer to AutoUpgrade.

Joe Craig, Patapsco Research Group
Complete DNN Support
Joseph Craig
DNN MVP
Posts:11667


--
03/17/2011 9:56 PM  
The third and fourth lines refer to problems executing scripts. Take a look at the file named DotNetNuke.Schema.log.resources and there should be more information. There are other log files mentioned that have errors logged, but the first should get you started.

These files are buried somewhere in the Providers or Install directory, I think. If you dig around, you'll find them.

Joe Craig, Patapsco Research Group
Complete DNN Support
Joseph Craig
DNN MVP
Posts:11667


--
03/17/2011 9:57 PM  
This may be a permissions error for the database user, but I really can't tell without looking at the log file.

Joe Craig, Patapsco Research Group
Complete DNN Support
SCMAO
Nuke Ace
Nuke Ace
Posts:56


--
03/17/2011 10:10 PM  
Ok, I found something. I checked the PortalAlias table on the new SQL server and it was completely empty.
It seems that I had all the tables created with the restore, but there is no data, so the database was corrupt.

How could I backup and restore the database to the new server? A simple backup and restore doesn't work, because of compatibility issues.
The source server is SQL Server Express 2008 R2 and the destination one is SQL Server 2008 Standard (R1).
When I try a restore of the backup on the destination, it gives me an error:
Restore failed for Server 'SQLSRV2'. (Microsoft.SqlServer.SmoExtended)
------------------------------
ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: The database was backed up on a server running version 10.50.1600. That version is incompatible with this server, which is running version 10.00.2531. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server. (Microsoft.SqlServer.Smo)

So the way I did before was this, but obviously not working:
In SQL Server 2008 Express R2:
- Open SSMS, right-click on oipmac-web databse, choose Tasks -> Generate Scripts...
- click Next
- choose "Script entire database and all database objects", click Next
- Save to file (save as "Unicode text"), Next, Next
- check if all actions show "Sucess" and click Finish
- Copy file "oipmac-web_bkp.sql" to new server

On new server:
Login to SSMS and run the script to restore the DB

Although both the backup and the restore show success, the database is still corrupt, or probably only created the database structure.

Anybody knows a better method for this?

Thank you very much,
Steven
SCMAO
Nuke Ace
Nuke Ace
Posts:56


--
03/18/2011 12:39 PM  
This is so frustrating. Somehow I lost my development database. And we have to redo the work of 4 people in the last week.
I found some advanced options under "Generate and Publish Scripts" and by default it is set to:
Types of data to script = "Schema only"
Probably this is why my backup script didn't contain any data, only the database structure. I am not sure how I lost the database, probably I run the restore script in the development server somehow, but I am not 100% sure if not when playing with advanced options somehow cleaned my current database.

I also discovered another thing, that setting file permission for the folder where the database files are, to give "Modify" permission for the windows service running the SQL server, is not enough.
Modify has all the rights except the "Full Control", but actually I had to set "Full Control" to allow SQL to work. Otherwise shows the database in SSMS but cannot open it (no + sign)
SCMAO
Nuke Ace
Nuke Ace
Posts:56


--
03/18/2011 2:38 PM  
I don't get it, I tried again and I get redirected to a page called UnderConstruction.htm under Install folder.
It shows:
This site is currently Unavailable
Please check back later

I found an article about the migration process here:
http://www.mitchelsellers.com/blogs...ation.aspx

I thought I followed everything exactly. There is one point where I might still need to fix:
" 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 "

My application name in IIS on the production server cannot be the same as it was on development server, because it was "Default Application", but on prod server I have other websites running too, and that name is taken. I tried to add the application name from IIS to the dbo.PortalAlias table and it still shows "This site is currently Unavailable".

Is there any log where I can see more information about what is the error?

Thank you,
Steven
Joseph Craig
DNN MVP
Posts:11667


--
03/18/2011 2:45 PM  
You will get the Under Construction message if you have set AutoUpgrade to false.

But ... it is still wanting run the Installation Wizard. So ... something still is wrong.

If you would like for me to take a look at your site, you can contact me privately using the Contact Us form at http://patapscorg.com.

Joe Craig, Patapsco Research Group
Complete DNN Support
Joseph Craig
DNN MVP
Posts:11667


--
03/18/2011 2:48 PM  
Just to clarify: Does the old site run just fine on the old server?

Have you tried using SQL Server Management Studio Express to connect to the new SQL Server? Can you do that? Do the login credentials that you use match the items in the two connection strings in your web.config file?

Joe Craig, Patapsco Research Group
Complete DNN Support
Joseph Craig
DNN MVP
Posts:11667


--
03/18/2011 2:48 PM  
Finally, have you reviewed the DNNCreative Tutorials on moving a site from a live site to "localhost" and then back again?

Joe Craig, Patapsco Research Group
Complete DNN Support
SCMAO
Nuke Ace
Nuke Ace
Posts:56


--
03/18/2011 3:33 PM  
Finally I figured out.

I used a tool called LINQPad on the production server where the IIS is and tried to connect with that to SQL server using the same settings from the connection string.
LINQPad connected, but only showed the database and no tables. I couldn't run any SELECT command (Error 229: The SELECT permission was denied on the object 'PortalAlias', database 'oipmac-web', schema 'dbo'.)
So I figured out that some permissions are still wrong on the database.
First I did this change and it fixed LINQPad, but the website still showed Under Construction:
- I right-clicked on the database, select Properties, went to Permissions on the left and checked the Grant column for "Select" for the user role (oipmac-web-user - the only role I have)

After this I went back and did this change on the DB server:
- Selected the SQL login name under SQL Server\Security\Logins, right-click, properties, selected User Mappings on the left, selected the user (oipmac-web) on the right, and checked the "db_owner" on the below area. - after this the website showed up.

Finally works. However I am still wondering if is not too much to assign db_owner rights.
What is the best practice to set the SQL permissions for a .NET application?

Thank you very much for your help.
Steven
Joseph Craig
DNN MVP
Posts:11667


--
03/18/2011 3:41 PM  
Yes, the user account used to connect to the database must have dbo privileges for that database.

Joe Craig, Patapsco Research Group
Complete DNN Support


---