Kevin.a
Kevin.a

Reputation: 4296

Recover database with laravel migrations

I lost my database since i moved servers. I still have the migrations in my laravel folder. And i also have this rater.sql file in the root of my project. Is there a way i could get my database back with the migrations?

Upvotes: 0

Views: 2251

Answers (2)

Emad
Emad

Reputation: 638

If you are using shared hosting you cant run command, so you can open your files in an FTP file manager (I prefer PHPStorm), then you can run below command as Hedam said:

php artisan migrate

now you can export the database to your localhost and import that on your hosting.

Upvotes: 3

Hedam
Hedam

Reputation: 2249

If you dumped your database, your data is lost. You can though restore the data structure with

php artisan migrate

Obviously, we do not know what rater.sql contains, so I suggest you look if any data can be recovered from this file.

Upvotes: 2

Related Questions