• Resolved lindaandjon

    (@lindaandjon)


    I am moving Host provider and cannot import my backup of my old site properly. It always fails with an error
    ERROR 1293 (HY000) at line 15169: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

    Looking at the SQL backup it seems that this is being caused by the creation of the table wp_ts_tracks as this is the only time current_timestamp appears twice in the SQL for the same table. It only appears one other time and that table is imported successfully. The wp_ts_tracks table does not get imported, nor do any tables after this. Could you suggest what’s going wrong please?

    CREATE TABLE IF NOT EXISTS wp_ts_tracks (
    id int(11) NOT NULL AUTO_INCREMENT,
    user_id int(11) NOT NULL,
    name varchar(255) NOT NULL,
    update timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    created timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
    source varchar(255) NOT NULL,
    comment varchar(255) NOT NULL,
    distance int(11) NOT NULL,
    PRIMARY KEY (id),
    KEY user_id (user_id),
    KEY user_id_2 (user_id),
    KEY user_id_3 (user_id)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=59 ;


    — Dumping data for table `wp_ts_tracks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author tinuzz

    (@tinuzz)

    Hi,

    Yes, the problem is that both ‘update’ and ‘updated’ columns are present. There should be only one of those, but which one is hard to say. Which version of Trackserver are you running?

    The column used to be called ‘update’, which is actually a bug, because it was always meant to be called ‘updated’. Only in the current development version of Trackserver there is a code to rename te column from ‘update’ to ‘updated’.

    I do have an idea on how this situation arose, but it’s hard to know for sure. Can you edit the database on the old host and make a new backup? In that case, please remove the column called ‘updated’.

    I just don’t understand how your old database can have both columns. I mean, your new database will not import it because the table definition is invalid, and your old database shouldn’t HAVE the table like this for the same reason!

    There’s something else that’s strange: the table has the KEY for the user_id column 3 times. This means that the code that updates the database after a plugin update has run multiple times. This shouldn’t have happened, but it’s not a big problem. So while you’re at it, before creating a new backup, please remove the keys called ‘user_id_2’ and ‘user_id_3’.

    I will add some code to prevent this from happening again. Sorry for the confusion.

    Best regards,
    Martijn.

    Thread Starter lindaandjon

    (@lindaandjon)

    Hi Martijn,

    I did post this but it seems to have vanished!

    Thanks for the quick reply and no worries about the problem – I feel relieved I’ve found what’s going on at last! Is it possible to just remove the fields and keys in the sql backup I have and corresponding data too – it looks straightforward, and there’s hardly any data. I’m afraid I don’t know what version of the plug in I have as I just have the back ups and can’t get the site to load yet due to the import errors.

    CREATE TABLE IF NOT EXISTS wp_ts_tracks (
    id int(11) NOT NULL AUTO_INCREMENT,
    user_id int(11) NOT NULL,
    name varchar(255) NOT NULL,
    update timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    created timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
    source varchar(255) NOT NULL,
    comment varchar(255) NOT NULL,
    distance int(11) NOT NULL,
    PRIMARY KEY (id),
    KEY user_id (user_id),
    KEY user_id_2 (user_id),
    KEY user_id_3 (user_id)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=59 ;


    — Dumping data for table wp_ts_tracks

    INSERT INTO wp_ts_tracks (id, user_id, name, update, updated, created, source, comment, distance) VALUES
    (5, 1, ‘2015 Morocco Trip ‘, ‘2015-03-05 08:01:58’, ‘2015-03-05 09:01:58’, ‘0000-00-00 00:00:00’, ‘TrackMe’, ”, 7262052),
    (38, 1, ‘2016 Rhine Cycle’, ‘2016-09-08 07:55:34’, ‘2016-09-08 07:55:34’, ‘2016-04-25 20:49:23’, ‘TrackMe’, ”, 1038907),
    (58, 1, ‘South Korea’, ‘2016-12-02 14:00:24’, ‘2016-12-02 14:00:24’, ‘2016-08-31 09:17:23’, ‘TrackMe’, ”, 11543240);

    — ——————————————————–

    • This reply was modified 8 years, 1 month ago by lindaandjon.
    • This reply was modified 8 years, 1 month ago by lindaandjon.
    Plugin Author tinuzz

    (@tinuzz)

    Hi @lindaandjon, I received an email about a reply from you in this forum, but somehow it’s invisible here.

    Yes, it is fine to edit the backup before restoring it. Remove the ‘updated’ column from the table definition and remove the corresponding field from each record in the data dump.

    When you upgrade to Trackserver 3.0 (will be released soon!), the column will be renamed to ‘updated’.

    Best regards,
    Martijn.

    Thread Starter lindaandjon

    (@lindaandjon)

    Ok Thanks
    Jon

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unable to restore Worpress database.’ is closed to new replies.