My web application is built using PHP Laravel framework, and I accidentally run php artisan migrate:fresh which is a command that drops all the tables and recreates them again.

I have done some research and it seems possible to recover the old table structure along with its data but I think my case is different than what I saw on other posts: I have the .frm and .ibd files, but I am not sure how to use them and if these are still useful.

I just want to know if I still can recover all the lost data.

  • 1
    No backups? After you solve this problem, that should be the first thing you set up. Jul 30, 2018 at 15:32
  • Nope I haven't created a backup yet the database is 2 weeks old but I've already added couple of data. Although I created a automation script but it creates backup every month not weekly.
    – DNM
    Jul 30, 2018 at 15:35
  • 1
    You should not crosspost: superuser.com/questions/1344520/mysql-innodb-recover-table-data Jul 30, 2018 at 16:12
  • @PatrickMevzek okay
    – DNM
    Jul 30, 2018 at 17:16
  • Are you binary logs active? If so you can be able to restore all your tables and data. Jul 30, 2018 at 17:47

1 Answer 1


if your data is mission critical and you really cannot move forward without it there are some very specialist tools on the market for recovery. There are only small amount of experts that know how to do this properly. I spent some years working at a consultancy that could do this with varying degrees of success and it was very expensive in terms of $ and time. Take a look on https://recovery.twindb.com/ to see if there's anything there that can be useful.

Don't forget to set your backups up to avoid this situation again in the future. There are plenty of tools out there that make this simple for you.



  • Thanks I've tried twindb it but couldn't complete the process I'm stack with an error "Segmentation fault" not sure what the error say. But thanks for showing other options appreciate it much. I actually have a schedule automated backups but the database was 2 weeks old and the automation was schedule monthly. Any way thank!
    – DNM
    Jul 31, 2018 at 1:40
  • If that dataset is important to you, you're much more likely to need something more frequent. Daily full backups whilst the data is manageable including binary logs. This will permit you to return to a point in time that is close to any failure or accident that occurs.
    – eroomydna
    Jul 31, 2018 at 8:41

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.