I'm importing an SQL script from the Laravel command, the theme I don't know how to do for the data extraction since they are not the same attributes that the new database has.
At the moment I have been able to open and read the file but I can't think of how to get the data out. I thought of doing a seeder but the file also brings me the creation of tables.
At the moment this is what I have in code
$db = $this->argument('db');
echo "Reading database from: $db \n";
echo "\n validating extension \n";
if (!preg_match('/(.*\.)(sql)$/',$db)) {
echo "Format not valid \n";
return;
}
echo "\n open script \n";
$data = fopen('C:/sites/'.$db,"rb");
$content = stream_get_contents($data);
$output = ImportSQL::remove_comments($content);
print_r($output);
exit;