i've been given this project. it's not mine but i have to make some changes to it, and i have migrated all the tables into my database they are all empty. what i want to know is that is there any way to load the data that the other person had inserted into the database into my own or not? and if yes how? i have searched the internet but all i could find was how to insert data in database as in using updating and storing and such but that's not what i'm looking for. i am using php 7.4.9 and laravel 8
CodePudding user response:
If you have access to others person DB you can exports the database and import it in yours .Other than that I don't think there is any other way to get that data . Migrations will only allow you to create the DB with the same structure.
CodePudding user response:
if you want to insert data in users table then do like this run command in composer php artisan make:seeder UserTableSeeder and press enter goto database directory app\batabase\Seeders or seeds folder and open file UserTableSeeder.php in this file inside run() function { User::create('name'=>'jone');}
CodePudding user response:
Get the database file from the other developer / export it yourself if you can access the server.
Import the DB file to your server and run your application.
You could do something like this if you are using mysql:
mysql -u root -p{your-password} {your-database-name} < /path/to/file
eg : mysql -u root -p password test_db < Downloads/_localhost-2022_01_11_14_59_37-dump.sql
