EChan42 EChan42 - 2 years ago 148
SQL Question

SQL error in Laravel when moving project between machines

I just moved my laravel project from one machine to another.
What I didn was:
-Create a new Laravel Homestead machine.
-Copy all files from my laravel app's folder

The website serves ok from my new machine but any database dependant operation fails because the tables aren't created in my new server. The error is the following:

QueryException in Connection.php line 673: SQLSTATE[42S02]: Base table or view not found:

The migrations are present in my new machine but I cant do a

php artisan migrate

or a

php artisan migrate:refresh

since both return

Cannot declare class CreateUsersTable, because the name is already in use

I've spent so much time here I don't know what to do.

Answer Source

delete all the tables from the database manually including the migrations table and run php artisan migrate

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download