Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Olly Berry 47 posts 68 karma points
    Jan 04, 2010 @ 17:25
    Olly Berry
    0

    Problem duplicating Umbraco installation

    Hi,

    I am trying to copy an entire Umbraco site to create a duplicate.

    After some research here on the forum I have taken the following steps:

    1. Backup database (MySQL) and Restore to new database (both on same server)

    2. Copied entire site files from existing folder to new folder (again both on the same server)

    3. Modified web.config connection string to point to new database

    I am running IIS 6 on Windows Server 2003, Umbraco 4.0.3 and this is all happening on the same box.

    My problem is that:

    a. If I try to browse the new site, all I'm getting is 404 errors

    b. If I go to the umbraco/umbraco.aspx page, I can log in, but all I get is this error:

    Server Error in '/' Application.



    Index was outside the bounds of the array.





    Description: An
    unhandled exception occurred during the execution of the current web
    request. Please review the stack trace for more information about the
    error and where it originated in the code.



    Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.



    Source Error:



    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.





    Stack Trace:



    [IndexOutOfRangeException: Index was outside the bounds of the array.]
    umbraco.cms.presentation._umbraco.Page_Load(Object sender, EventArgs e) +1716
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
    System.Web.UI.Control.OnLoad(EventArgs e) +99
    umbraco.BasePages.BasePage.OnLoad(EventArgs e) +15
    System.Web.UI.Control.LoadRecursive() +50
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627






    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

     

     

    As far as I can tell, the new site is set up just the same as the existing one in IIS and everything I've read says the steps I've taken should have worked.

    Can anyone help me out here?


    Many thanks,

    Olly

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 04, 2010 @ 17:41
    Dirk De Grave
    0

    your backup/restore scenario should do fine...

    3a -> you'd need to publish the entire site again, right click on any top level node and select 'Publish' from the context menu. Additionally, select 'Republish entire site' from the 'Content' node.

    3b -> sounds odd, and no idea what could be the issue here.

     

    Cheers,

    /Dirk

  • Olly Berry 47 posts 68 karma points
    Jan 04, 2010 @ 17:48
    Olly Berry
    0

    Thanks for the reply Dirk.

    Unfortunately I can't republish the entire site as I can't get into the CMS to do so because of the second issue!!

    So it seems I probably just have the one problem, and when that's resolved I can republish.

    Anyone else have any idea?

  • Olly Berry 47 posts 68 karma points
    Jan 04, 2010 @ 18:59
    Olly Berry
    0

    An update...

    I have tested the new site using the old database and it works just fine.

    I have tried dropping and recreating the new database (by backup/restore and by dumping the SQL and running it on the new db) and every time I'm getting the same error.

    I guess it's down to a db issue, but I can;t figure out what...

    Hopefully someone can help.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 04, 2010 @ 19:09
    Douglas Robar
    0

    Great debugging to deterimine that it is the database. I've done this exact thing loads of times and never had a problem... but I use MSSQL, not MySQL. Perhaps there's something unique to MySQL and the way it does backup/restore or that some table constraint isn't being maintained? It sounds like a MySQL issue.

    I know that's not much help, but as you say, it narrows down the places to look.

    Are there specific backup/restore tools for MySQL? Or do you have to script the tables and data as sql statements? Hopefully the former. If the latter, try this... install umbraco version "whatever-you-are-running-on-the-live-site" afresh, creating a new MySQL database. Then copy in your files from the backup. Then run your sql scripts to bring in your data.

    If that all fails, tell us more about your configuration and maybe someone will have some experience to share.

    Keep us posted.

    cheers,
    doug

  • Olly Berry 47 posts 68 karma points
    Jan 04, 2010 @ 20:58
    Olly Berry
    0

    Thanks Doug.

    I'm using NaviCat for MySQL which has Backup/Restore functions built in and I've tried using that  to create both compressed and uncompressed backups which I'm then "Restoring" to the new db. It also has a SQL dump option which outputs the SQL scripts to recreate the tables and populate them.

    As I say, both methods result in the same error :(

    I had considered doing a fresh umbraco install and copying everything across, which I will now definitely try tomorrow morning when I'm back in the office.

    I was hoping it would be more simple as the site is a template for a "product" which we're hopefully going to be reproducing many times over. I may have to reconsider my database provider - I much prefer SQL Server in any case, but obviously cost is a factor (how does Umbraco get on with SQL Express?)

    I'll let you know how I get on in any case.

     

    Cheers,

    Olly

  • Jamie Howarth 306 posts 773 karma points c-trib
    Jan 04, 2010 @ 21:19
    Jamie Howarth
    0

    Hi Olly,

    Umbraco handles SQL Express fine. My Medium Trust build supports SQL Express user instances for development in VWD Express out-of-the-box if that helps.

    Have you checked your MySQL DB collation? I know that that can sometimes cause issues between dev and live sites.

    Hope this helps.

    Benjamin

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 04, 2010 @ 21:27
    Douglas Robar
    1

    Great point about collation settings by Benjamin. It almost has to be something very simple but not entirely obvious, doesn't it!

    Umbraco runs great with MS SQL Server Express. In fact, I've yet to run a site with anything but SQL Express. For very large sites it might be helpful but it's a simple job to upgrade if your site ever needs the extra performance more memory and cpus can give you. But as I say, SQL Express is awesome. And free.

    cheers,
    doug.

  • Olly Berry 47 posts 68 karma points
    Jan 05, 2010 @ 00:04
    Olly Berry
    0

    Thanks Benjamin, I'll check the collation in the morning before anything else - Now you mention it, I feel distinctly unsure about it! Tempted to connect to the VPN to check now, but it's late - it'll wait till morning.

    Doug - that's good to know - MySQL is a great resource, but I do seem to have more problems with it and TBH my heart belongs to SQL Server. I think I'll be using SQL Express for future projects.

    Cheers guys

  • Olly Berry 47 posts 68 karma points
    Jan 05, 2010 @ 10:09
    Olly Berry
    0

    Collation on both databases is latin1_swedish_ci (damn!) so I'm going to try the fresh install approach.

  • Olly Berry 47 posts 68 karma points
    Jan 05, 2010 @ 10:50
    Olly Berry
    0

    Well, that didn't work either! I did a fresh install, copied all the files across on IIS, then used a SQL dump just to populate all the tables, but it failed. I was able to get into the CMS, but there was nothing there! Tried using the full SQL dump to rebuild the database and I'm back to the same problem. I think I'm going to rebuild the whole thing using SQL Express unless anyone has anything else to suggest?

  • Olly Berry 47 posts 68 karma points
    Jan 05, 2010 @ 17:34
    Olly Berry
    0

    OK, I've rebuilt the whole thing using SQL Express as the db. Fingers crossed. Incidentally what is the best way to copy the database in SQL Express (I have the 2005 version)

    Many thanks,

  • Olly Berry 47 posts 68 karma points
    Jan 05, 2010 @ 17:49
    Olly Berry
    0

    Don't worry, I figured it out.

    That was utterly painless - successfully copied the whole lot in about 15 minutes - it seems SQL Express is the way to go - thanks to you all for your help : )

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 05, 2010 @ 17:50
    Douglas Robar
    0

    I have consistently good luck with a backup/restore procedure:

    - right-click the database in SQL management studio

    - select Tasks > backup

    - create a new/empty database; right-click; Tasks > restore

     

    You may find that you end up with an 'orphaned user'. If so, just google it and you'll find you need to run one query to find the name of the orphaned user and another to fix it. Very simple.

    Let us know how it goes!

    cheers,
    doug.

  • Olly Berry 47 posts 68 karma points
    Jan 05, 2010 @ 23:51
    Olly Berry
    0

    Thanks Doug - worked first time! No problems at all. It's all running on SQL Express now and it's a dream : )

    I'm a little frustrated that I couldn't fix the problem with MySQL, but purely because I hate to let a problem beat me - I'm actually much happier and more experienced with SQL Server.

    I'll be using SQL Express for this product now as I'm confident I can duplicate/deploy in around 15 minutes (as opposed to the hours I wasted yesterday trying to get it going on MySQL!)

    Thanks again,

    Olly

  • BarneyHall 141 posts 210 karma points
    Jan 06, 2010 @ 18:24
    BarneyHall
    0

    Hi Doug / Olly, sorry for cutting in on your post but I'm having some problems doing as per your steps Doug.

    I've also had success up until recently, and while I'm trying to work out where I'm going wrong with a recent problem (see this post if your interested) I've noticed I had more of a struggle restoring the db than normal.

    If I created a new database and try to restore from a backup device, I'm getting the message "The backup set holds a backup of a database other than the '(my new database name)' database".

    I can get around it by choosing to overwrite the existing db, but I wondering if this is right and whether this is the source of my problem?

    Sorry for my ramblings, but I'm a bit stumped and would appreciate someone who knows what they're doing giving me some advice.

    Cheers chaps,
    Barney

  • Olly Berry 47 posts 68 karma points
    Jan 06, 2010 @ 18:48
    Olly Berry
    0

    Barney, that's how I did it, making sure to specify the new db as the target.

    As to whether it's the right way, I can't tell you, just that it works!

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 06, 2010 @ 19:07
    Douglas Robar
    0

    When you do the db backup, be sure to set the option to NOT append to an existing backup; this will give you the smallest database backup.

    Then, when you restore, go ahead and overwrite the new database you'd created.

    And, you might need to handle an orphaned user but you'll see a message about it if you can't log in to the restored database. Otherwise... that should do it.

    If you have more problems, start a new thread so we can keep the discussion centralized to each issue.

    cheers,
    doug.

  • BarneyHall 141 posts 210 karma points
    Jan 06, 2010 @ 19:31
    BarneyHall
    0

    @Olly, yeah it's always been ok before. I've obviously done something but I can't figure out what. Typical! :)

    @Doug, ok I'll try that, many thanks.

  • René Pjengaard 117 posts 700 karma points c-trib
    Jan 27, 2010 @ 15:38
    René Pjengaard
    0

    Hi Olly

    did you find any solution. I´m having the axact same problem.

     

    Regards
    René

  • Olly Berry 47 posts 68 karma points
    Jan 29, 2010 @ 00:46
    Olly Berry
    1

    Yes - I binned off MySQL and rebuilt the site using SQL Server Express as the database!

  • Jamie Howarth 306 posts 773 karma points c-trib
    Feb 23, 2010 @ 02:03
    Jamie Howarth
    0

    Lol. Funny you went for this approach. I'm running my site (finally) on GoDaddy shared hosting (hooray!) with MySQL (cause they offer 25 DBs, but only 2 MSSQL DBs, with rubbish backup/restore options, whereas with MySQL I can use HeidiSQL), and I'm having the exact same problem.

    Will investigate and report back.

    Benjamin

  • Jamie Howarth 306 posts 773 karma points c-trib
    Feb 23, 2010 @ 13:24
    Jamie Howarth
    0

    I found it! :-D

    When running the MySQL migration script, check your admin user ID. Mine changed from 0 to 3. This one simple thing cause me hours of pain last night!

    Hope this is useful - it's not an Umbraco bug as such, just be careful with MySQL migration scripts.

    Benjamin

  • Anton Krupnov 3 posts 22 karma points
    May 15, 2010 @ 19:40
    Anton Krupnov
    0

    User might be not related to any sections in the umbracoUser2app table. Add those assotiations and it will work.

  • Tom W 39 posts 96 karma points
    Aug 29, 2012 @ 21:11
    Tom W
    0

    Only found this thread after debugging and puzzling through the issue. I initially installed to MySql fine, but it was when I backed up (to a SQL script) and tried to restore on a production server, I was having issues with logging in to Umbraco, plus others. 

    Turns out that the MySql dump, by default, has an option set to "Auto value on 0", and the default Umbraco user has a PK of 0. http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html#sqlmode_no_auto_value_on_zero 

    You can turn this off with

    SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'; 

    I also had a few foreign key errors on cmspropertydata (probably due to some bad cleanup when properties are renamed/deleted and the nodes have not been)

    SET FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;

    (remember to set it back to 1 afterward you've created/imported your database)

    Issues resolved. If you have a need to not use SQL Server of any flavour, or find that the limit of 1GB RAM or max DB size of 4GB might be a pain, MySql does still seem like a nice way to go without the cost overhead of full-blown SQL Server.

Please Sign in or register to post replies

Write your reply to:

Draft