We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17412
    • 270 Posts
    Hiya,
    I’m having some issues importing Modxcms sql data to SQL version 4.0.27.
    The site was developed on SQl 4.1.20 and needs to be set up at 1&1 hosting which run this older version.

    Phpmyadmin reports errors with the first sql statement:

    MySQL said: Documentation
    #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ’DEFAULT CHARSET=latin1 COMMENT=’Contains data about active user
    CREATE TABLE `modx_active_users` (
    `internalKey` int( 9 ) NOT NULL default '0',
    `username` varchar( 50 ) NOT NULL default '',
    `lasthit` int( 20 ) NOT NULL default '0',
    `id` int( 10 ) default NULL ,
    `action` varchar( 10 ) NOT NULL default '',
    `ip` varchar( 20 ) NOT NULL default '',
    PRIMARY KEY ( `internalKey` )
    ) ENGINE = MYISAM DEFAULT CHARSET = latin1 COMMENT = 'Contains data about active users.'
    


    Any ideas on how I can amend the syntax to be compatible?

    Thanks.
      • 33337
      • 3,975 Posts
      On your 4.1.x server, export it in mysql 3.x compatibility mode, then import on 1and1... try it.
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 17412
        • 270 Posts
        ah ha - I hadn’t seen that option before in phpmyadmin.

        Nice one Zi - thanks for your help!
          • 17412
          • 270 Posts
          Another wee issue has emerged...

          When I try and log in to the site I get an error alert popup -

          ....
          execution of a query to the database failed - duplicate entry ’0’ for key 1...
          error while inserting log into database

          Also all content items have the following error message at bottom of pane:

          « MODx Parse Error »
          MODx encountered the following error while attempting to parse the requested resource:
          « Execution of a query to the database failed - Duplicate entry ’0’ for key 1 »
          SQL: INSERT INTO `db123456789`.`modx_manager_log` (timestamp, internalKey, username, action, itemid, itemname, message) VALUES(’1189169164’, ’1’, ’userName’, ’27’, ’65’, ’About’, ’Editing document 65’)


          When I create a new item and try to save it I get:

          Couldn’t get last insert key!

          Please help :0
            • 22303 MODX Staff
            • 10,725 Posts
            The MySQL dump script in 3.xx compat mode does not support auto-increment fields, so you’ll probably need to go manually add all the auto-increment indicators to each table that had them in the original tables.
              • 17412
              • 270 Posts
              ah ha - okay perfect - I’ve updated all table relevant table id with phpmyadmin and it’s all working again.

              Many thanks!