Put simpledata file first to dir where exist this index.php
put Old prefix here if it use


put New prefix here


choose file with simpledata.sql


"; if(isset($_GET['newPrefix']) && isset($_GET['fileName']) && isset($_GET['submit'])) { $oldPrefix=$_GET['oldPrefix']; $newPrefix=$_GET['newPrefix']; $fileName=$_GET['fileName']; // your prefix here $prefix = $newPrefix; // magento sample data file $dumpFile = $fileName; // new sample data file $outFile = 'with-prefix-' . $newPrefix . '-' . $fileName; if($oldPrefix == null){ $search = array("TABLES `", "TABLE `", "EXISTS `", "INTO `", "REFERENCES `"); } else { $search = array("TABLES `$oldPrefix", "TABLE `$oldPrefix", "EXISTS `$oldPrefix", "INTO `$oldPrefix", "REFERENCES `$oldPrefix"); } $replace = array("TABLES `$prefix", "TABLE `$prefix", "EXISTS `$prefix", "INTO `$prefix", "REFERENCES `$prefix"); $file = file_get_contents($dumpFile); if ($file !== FALSE) { $file = str_ireplace($search, $replace, $file); if (file_put_contents($outFile,$file) !== FALSE) { echo "Successfully written new sample data dump to $outFile.n"; unset($_GET); } else { echo "Error writing new sample data dump.n"; } } else { echo "Error reading dump file.n"; } } else { echo "fields are empty!"; } ?>