Running a PowerDNN backup on Localhost
Last Post 06/13/2012 5:08 PM by Brett Levert. 16 Replies.
Author Messages
Merv
Posts:20


--
09/06/2011 12:56 AM  
I'm trying to set up a PowerDNN backup onto my localhost. Created and alias localhost/mysite. I just keep being redirected to the live site. Removed all alias from the PortalAlias table leaving just localhost/mysite. Still I get redirected.

What's everyone doing?

Merv
Joseph Craig
DNN MVP
Posts:11667


--
09/06/2011 6:58 AM  
Did you change the connection strings to point to your local database?

Joe Craig, Patapsco Research Group
Complete DNN Support
Merv
Posts:20


--
09/06/2011 11:25 AM  
Yes Joe did that. Unless of course if it is wrong.

[add name="SiteSqlServer" connectionString="Data Source=.\SQLExpress;Initial Catalog=db-name;User ID=username;Password=password;" providerName="System.Data.SqlClient"]

and

[add key="SiteSqlServer" value="Data Source=.\SQLExpress;Initial Catalog=db-name;User ID=username;Password=password;"]

I'm a newbie over at PowerDNN Their support is second to none but this is outside there scope. Never had a problem on my previous host. With PowerDNN in Plesk there is a section for adding alias names and also in DNN Host > Portals. Is there a conflict by having the alias names in both locations?
Joseph Craig
DNN MVP
Posts:11667


--
09/06/2011 1:22 PM  
Is your local site named similarly to your live site? (I'm trying to understand how it's redirecting to your live site if the portal aliases have been removed.)

Joe Craig, Patapsco Research Group
Complete DNN Support
Merv
Posts:20


--
09/19/2011 5:50 PM  
I don't know. Still can't get this working on Localhost, Never a problem until I moved to PowerDNN. Tried a new backup file sets deleted all aliases from the DB and inserted just a localhost/domain alias and still redirects to the live site. Even tried setting as localhost/domain.com.au. Still redirects to PowerDNN

I do get this web.config message

Line 201: -->
Line 202: <!-- allow large file uploads -->
Line 203:
Line 204:
Line 205: <!-- GLOBALIZATION

Change to false and still get it. Comment the line out and redirect to PowerDNN. I have removed all aliases from local DB and inserted just localhost/name in various forms and installs and always goes back to PowerDNN.

Even with a site off line file before the web.config goes back to PowerDNN.
Joseph Craig
DNN MVP
Posts:11667


--
09/19/2011 6:19 PM  
Here is what I do:

1. Login to PowerDNN and make a backup of your database. Download it and restore it to your local database. Add a PortalAlias entry for your local URL.

2..I generally use FTP to connect and download the entire web directory to the local web directory. That is, download the contents of the httpdocs directory.

3. You'll need to edit the two connection strings in the web.config file so that they point to your local database.

Then, if you browse to your local site, you should see it.

There should be no references to the live site unless there are hard-coded links that refer you to that URL. You can use Fiddler to see if this is happening.

Joe Craig, Patapsco Research Group
Complete DNN Support
Merv
Posts:20


--
09/19/2011 10:31 PM  
Thanks Joe. That's pretty much what I'm doing other than I am making a back using control Panel then downloading the zip file. Will try using FTP. Will let you know how it goes.

Missing code from above.

Line 202:    <!-- allow large file uploads -->
Line 203:    <httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="2097151" requestLengthDiskThreshold="25819200" requestValidationMode="2.0" />
Line 204:    <httpCookies httpOnlyCookies="true" requireSSL="false" domain="" />
Line 205:    <!--  GLOBALIZATION
 
Joseph Craig
DNN MVP
Posts:11667


--
09/19/2011 10:56 PM  
Ah ...

the requestValidationMode="2.0" is valid only if your webserver is running ASP.NET 4.0. If you remove that (and there may be other places in web.config, it should run.

Joe Craig, Patapsco Research Group
Complete DNN Support
Merv
Posts:20


--
09/20/2011 1:57 PM  
I had taken the entire line out not just the requestValidationMode="2.0". Took that out and I have 3 instances set up using different localhost/name they all run now and all redirect to PowerDNN. Must be to do with the way the urls are written. I developed the site on another host but they weren't up to speed with DNN so moved to PowerDNN must say it has been a trial. The guys over there are very helpful but they don't have much to say once you are outside their network.

They set you up initially as you would know with domain.dnnmax.com then when going live change it to domain. Many of the links were broken and I had to manually fix them and on top of that there are 5 aliases besides localhost.

I think I saw a setting that can be set to resolve all aliases to the primary. That maybe the problem as I think I set it On.
Joseph Craig
DNN MVP
Posts:11667


--
09/20/2011 2:19 PM  
By taking the other attributes out, you've limited the size of files that can be uploaded, I think.

Look at the page source to see the actual links that appear. You should be able to tell if the links with the wrong domain are hard coded in your site or if they are result of some redirection. If it's the former, track them down and change them to relative links.

Joe Craig, Patapsco Research Group
Complete DNN Support
Merv
Posts:20


--
09/20/2011 2:21 PM  
Just had a look around at settings. in Admin > Site Settings > Advanced Settings > Portal Aliases > PortalAlias Mapping Mode: None - Canonical - Redirect. I'm set at redirect (Redirects to the default alias). Could be the culprit. Where do you set to None or Canonical or is there somewhere in the DB to turn that off (Redirect) on localhost?
Merv
Posts:20


--
09/20/2011 3:05 PM  
Links appear to be absolute.

Just had a look around at settings. in Admin > Site Settings > Advanced Settings > Portal Aliases > PortalAlias Mapping Mode: None - Canonical - Redirect. I'm set at redirect (Redirects to the default alias). Could be the culprit. Where do you set to None or Canonical or is there somewhere in the DB to turn that off (Redirect) on localhost?
Merv
Posts:20


--
09/20/2011 3:07 PM  
Sorry already posted that. Didn't see that we had gone to page 2.
Joseph Craig
DNN MVP
Posts:11667


--
09/20/2011 6:46 PM  
If your links are absolute, it is likely that they are hard coded in HTML modules. You can edit those modules to make the links relative. Engage Software's F5 module is a free to that can help you do global search/replace on HTML modules. I've found it quite useful for similar tasks.

Joe Craig, Patapsco Research Group
Complete DNN Support
Merv
Posts:20


--
09/20/2011 10:03 PM  
Interesting. I have always been loading the default.aspx (localhost/domain) then getting redirected. Tried coming in somewhere else and we stayed on localhost, back to home.aspx and okay. Tried localhost/domain (default.aspx) and redirect again.
Brett Levert
Nuke Ace
Nuke Ace
Posts:41


--
06/13/2012 4:59 PM  
I realise this post is quite old now but I am having the exact same issue.

Using WebMatrix and backup from PowerDNN trying to get it setup but keep getting redirected to my live site

I manually edited the alias table in the offline db and removed all aliases except the localhost one

Now when browsing to http://localhost:1851/mtw4u it redirects to www.makethemworkforyou.com/mtw4u and I get a 404

I tried putting in a URL to a deeper page but the same thing happens.

Any fix for this issue found?

Keep Tabs on Our Politicians!
Make Them Work For You

Brett Levert
Nuke Ace
Nuke Ace
Posts:41


--
06/13/2012 5:08 PM  
Nevermind!!

Solved the issue:

Manually edited PortalSettings> DefaultPortalAlias (set to local host)
Also changed PortalAliasMapping to None

Keep Tabs on Our Politicians!
Make Them Work For You



---