Results 1 to 7 of 7

Thread: restore from mysql dump error

  1. #1
    along is offline Sugar Community Member
    Join Date
    Oct 2006
    Posts
    40

    Default restore from mysql dump error

    I am trying to restore a mysql dump of the whole sugarcrm db (onto new server). When logging in to the new server, I get:
    "Sugar CRM 4.2.1b Files May Only Be Used With A Sugar CRM 4.2.1 Database." Can anyone tell me how to proceed?

    I should add that the version on the new server is the latest (with rPath linux os). The mismatch, I'm guessing, is because the dump was of an older version of sugar... The "old" box was running sugar 4.0.1.

    I have a complete tar.gz of /var/www/html/sugarcrm, as well as the mysql dump.

    I have considered upgrading the old box to the latest sugar version first, but have read of many problems encountered in upgrading...

    --Andrew
    Last edited by along; 2006-10-14 at 10:35 PM.

  2. #2
    tdp
    tdp is offline Sugar Community Member
    Join Date
    Sep 2005
    Posts
    74

    Default Re: restore from mysql dump error

    I think you need to do this one of two ways. Either install the old version on the new server, then go through the upgrades or upgrade the old server (or better, a copy of the old server) and then do a mysqldump onto the new server. You are right that the upgrade is going to run into trouble, so you don't want to do it on your production server.

  3. #3
    along is offline Sugar Community Member
    Join Date
    Oct 2006
    Posts
    40

    Default Re: restore from mysql dump error

    Anyone know where I can get a copy of sugar 4.0.1? They don't go that far back in the download section.

    Scratch that... I missed it at a quick glance, SugarSuite-4.0.1h.zip is available.
    Last edited by along; 2006-10-15 at 02:41 PM.

  4. #4
    chrisky is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    Trondheim, Norway
    Posts
    293

    Cool Re: restore from mysql dump error

    Hogwash!

    Heres what we've done in this scenario, though it worked (and continues to work) for us, no guarantees or promises...

    Install your new (newer/newest/etc) version/installation of sugar and have it create an EMPTY (data/record-less) default database..

    Then whatcha do, is take that sql dump and fire it up in your text editor...

    Import just the data, all the data, throughout your modules...

    If you want to experiment and see what I mean, then do the following:
    open sql dump in text editor;
    browse to the 'run sql code' screen in either phpMyAdmin or Webmins MySql module;
    with both running on your computer, cut & past the data portion of your dump file for a particular module that you have data in,

    to illustrate, here is the sql code that you would cut & paste into a gui frontend (phpMyAdmin/Webmin/etc):

    /*!40000 ALTER TABLE `upgrade_history` DISABLE KEYS */;
    LOCK TABLES `upgrade_history` WRITE;
    INSERT INTO `upgrade_history` VALUES ('99841bb5-31d7-b2b3-9e66-451012789bea','/var/www/html/crm450/cache/upload/upgrades/patch/SugarSuite-Patch-4.5.0b.zip','fd29c38eac37cef7f2743bac293000b6','pa tch','installed','4.5.0b','2006-09-19 15:51:46');
    UNLOCK TABLES;
    /*!40000 ALTER TABLE `upgrade_history` ENABLE KEYS */;

    In the above example, I only have one record though in your case there will be many more..
    So, take a module like leads, contacts, whatever, and try it!
    Then go take a peak in Sugar and watch in amazement as those records are available!

    Also, if you made custom fields, you'll find that you WILL need to import/run the sql code to create those tables..

    Another stunt you might want to look at in which we've come up with, (since you already have the sql dump) is in your case restoring the sql dump, THEN dumping it without dropping and in an update format.. You should then be able to import/run the whole sql file on top of you new sugar installations database and be good to go..

    If all else fails, there's always the manual editing of the sql file (and or cut & pasting it, if you want to go slow and verify it has worked module by module) or doing it in cut & paste portions..

    or you can also try changing the sugar version in info sugar_version under the config table, I think that'll do it, though haven't bothered trying..

    And for everyone else out there, take notes as I'll give ya a hint......This is the key (trick) to xfr'ing data between deifferent installations of sugar..

  5. #5
    tdp
    tdp is offline Sugar Community Member
    Join Date
    Sep 2005
    Posts
    74

    Default Re: restore from mysql dump error

    That certainly would work (and I had to do something similar to go from 3.x to 4), in my opinion it is a LOT more painufl and prone to error than simply working your way through the upgrades. Of course, to each his own.

  6. #6
    chrisky is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    Trondheim, Norway
    Posts
    293

    Default Re: restore from mysql dump error

    Quote Originally Posted by tdp
    That certainly would work (and I had to do something similar to go from 3.x to 4), in my opinion it is a LOT more painufl and prone to error than simply working your way through the upgrades. Of course, to each his own.

    'To each his own'
    That's a good one.. I like that... I oughta make that my signature line..

    It can be time consuming but also can be pretty quick, if you just edit the sql dump file (a txt file)... Though if there are table differences, it's your best bet to restore the db, and redump it without drop, with update, and create if not existing..

    People really should get familiar with this ability, because many others like us, might find the need to want to xfr portions of data between sugar installations, and no other way exists..

    We've gone through so much trouble with upgrades to date, that we run from them rather than embrace them.. The few fixes or feature improvements offered by an upgrade are usually outweighed by the new bugs or problems the upgrade introduces..

    As if working with a single upgrade doesn't scare me, working with many upgrades terrifies me, and at least with my luck, I'd end up with a final installation that had more problems that humanly possible to fix..

    And for us, just running sugar is PAINFUL....
    Guess we get what we pay for.. lol

  7. #7
    tdp
    tdp is offline Sugar Community Member
    Join Date
    Sep 2005
    Posts
    74

    Default Re: restore from mysql dump error

    Quote Originally Posted by chrisky



    We've gone through so much trouble with upgrades to date, that we run from them rather than embrace them.. The few fixes or feature improvements offered by an upgrade are usually outweighed by the new bugs or problems the upgrade introduces..

    As if working with a single upgrade doesn't scare me, working with many upgrades terrifies me, and at least with my luck, I'd end up with a final installation that had more problems that humanly possible to fix..

    And for us, just running sugar is PAINFUL....
    Guess we get what we pay for.. lol
    You know, the Sugar development team ought to print that out in big, bold letters and hang it in a prominent place. You have described my experience with Sugar EXACTLY. Don't get me wrong, I like using Sugar, but I loathe maintaing it. I guess what pisses me off the most is that Sugar obviously encourages a development community, yet I was forced to stop using most 3rd party stuff because the upgrades to Sugar itself either nuked those add-ons or the add-ons rendered the upgrade impossible.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •