Moving Site 2 to Site 1

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
10/23/2012 3:41:14 AM
Gravatar
Total Posts 133
J

Moving Site 2 to Site 1

Hi Guys

MP 2.3.9.0 w2003 IIS6 SQLS2005

I know this has been discussed before but I can't find the thread in here.

The situation is that I have a site under development that is nearly ready for final deployment and I now discover that it will be hosted on a unique IP without host headers IIS6 w2003. The site is actually site 2 but site 1 was just used for some testing and the overall administration so I have no problem loosing the site1 content.

Has anyone scripted the database changes necessary to remove site 1 and promote site 2? It's on SQLS2005. I can no doubt figure it out and mess around with copy databases but was hoping someone who has trod this path before might be willing share their scripting.

Cheers

John 

10/23/2012 6:18:42 AM
Gravatar
Total Posts 18439

Re: Moving Site 2 to Site 1

Hi John,

1. go into the mp_Sites table and change IsServerAdminSite to true for site 2 and false for site 1.

2. add this in user.config if you don't already have it:

<add key="AllowDeletingChildSites" value="false" />

 

3. Touch web.config to clear the cache

4. Delete site 1 from the UI

Now site 2 is the default site

Hope that helps,

Joe

10/23/2012 6:39:21 AM
Gravatar
Total Posts 133
J

Re: Moving Site 2 to Site 1

Great stuff Joe - much simpler than I thought! 

Cheers

J

10/23/2012 7:54:24 AM
Gravatar
Total Posts 18439

Re: Moving Site 2 to Site 1

Actually I think deleting site 1 is not neccessary as long as you add the host name mapping in site 2.

Best,

Joe

10/23/2012 8:54:42 AM
Gravatar
Total Posts 133
J

Re: Moving Site 2 to Site 1

In this instance it will be necessary as we have chosen this method to force the whole site onto SSL and will not be using host headers at all. Running your own servers with full control of the addressing and firewall has it's advantages!

http://blogs.microsoft.co.il/blogs/dorr/archive/2009/01/13/how-to-force-redirection-from-http-to-https-on-iis-6-0.aspx

Will try it out first on our dev server first with a copy db :-)

J

10/23/2012 9:09:43 AM
Gravatar
Total Posts 18439

Re: Moving Site 2 to Site 1

The thing is what I'm saying does not require host headers either, the hostname mapping is just internal to mojoportal (not the same thing as IIS host headers, its done from the site settings page in mojoPortal) and maps the requested host name to a site id. If there is no host name mapping in mojoPortal it will resolve to the lowest site id (in which case deleting site 1 would make it resolve to site 2) but if a host name is mapped to site id 2 in mojoportal it will resolve to the specified site id so deleting site 1 is not really required.

Best,

Joe

10/23/2012 9:10:42 AM
Gravatar
Total Posts 18439

Re: Moving Site 2 to Site 1

Also mojoPortal can be set to force SSL on all pages from Site Settings.

Best,

Joe

10/23/2012 9:55:58 AM
Gravatar
Total Posts 133
J

Re: Moving Site 2 to Site 1

Thanks again Joe - apart from being the best CMS by far your support is stellar. 

So are you saying that I can force SSL on all pages just through Mojo and not have to do the jiggery-pokery in IIS? Haven't tested any of this yet as I still have to but a new cert.

Must be time to talk to the boss about beer vouchers will do so when we get this beast live :-)

J

11/28/2012 6:48:14 AM
Gravatar
Total Posts 133
J

Re: Moving Site 2 to Site 1

Thanks again Joe - the site is now live and running all on HTTPS without any of the IIS trickery I thought I would need. Mojo is wonderful!

You instructions above were a tiny bit off so in case someone reads this in the future the setting <add key="AllowDeletingChildSites" value="false" /> needs to be true obvs :-)

http://www.workwithus.org

Beer vouchers due

Cheers

John

11/28/2012 10:10:54 AM
Gravatar
Total Posts 18439

Re: Moving Site 2 to Site 1

Hi John,

Many thanks for the beers! Much appreciated.

Cheers,

Joe

You must sign in to post in the forums. This thread is closed to new posts.