0

A couple of months ago I migrated to another mysql server, and I did an export and import through the phpMyAdmin web interface. I just realized that I just lost all the "creation dates" for multiple tables, as they all got overwritten with what I believe is the date of the import operation.

Not a big deal right now, as it's all still development test data, but this would've been a massive loss during production (if I ever needed to migrate again).

Any ideas as to why this happened, or how to prevent it from happening again? As I mentioned in the title, the columns' 'type' were all set to Datetime, 'default' set to CURRENT_TIMESTAMP, and I just noticed that 'extra' is set to DEFAULT_GENERATED (this might be an indication of the problem, as I've never seen this before).

Note: Current version is 8.0.20, and I believe the older server was on 5.6. Also, I'm pretty sure I left alone all the export/import settings. I remember the import threw a complaint, but I believe it had something to do with the default sql tables.

EDIT

So, I just looked into the .sql file that was generated by the Export, and I can see the INSERT INTO (..) VALUES (...) doesn't include the creation_date column or any of its data. So something must've been wrong on export. Any ideas what to look for on my next export?

5
  • any migration must be from 5.6 to 5.7 to 8.0, if you didn't do it, god knows, what else isn't right. And normally that shouldn't work with running the upgrade scripts.
    – nbk
    Jun 20, 2021 at 21:31
  • Were you doing the export using phpmyadmin export feature or using a command-line?
    – FanoFN
    Jun 21, 2021 at 0:39
  • I'm pretty sure it was phpmyadmin
    – Merricat
    Jun 21, 2021 at 1:35
  • I did migration from older MySQL a few years back and I was using command-line to do it. I remember having some issue with the import and I think it was caused by compatibility issue? If I'm not mistaken, for older MySQL, the import command should include --compatible for the import to worn on newer MySQL version. I'm sorry but I can't test this now since we're not using MySQL anymore but I did find an answer regarding on it. Maybe you can try that
    – FanoFN
    Jun 21, 2021 at 2:57
  • There seems to be a phpmyadmin-bug that might cause this, see PhpMyAdmin Table Export ignores timestamp column. It probably should not happen if your old server was 5.6., so maybe you remembered that incorrectly, as the rest fits your situation (or maybe it happens in other situations also).
    – Solarflare
    Jun 21, 2021 at 13:09

1 Answer 1

1

Thanks all for the comments. This is the info at the top of the .sql file:

-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Mar 24, 2021 at 07:42 PM
-- Server version: 8.0.20
-- PHP Version: 7.3.11

So it seems I exported from 8.0.20...weird, I was sure it was 5.6. Anyway, the problem seems to be exactly what @Solarflare mentioned, and seems to be fixed on a new version of phpMyAdmin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.