Replace string on db (PHP)
First take a db dump (check this)! Then use this (at your own risk!) <?php $file = “db-dump.sql”; $replace = array( “http://ratikal.gr” => “https://ratikal.gr”, ); $contents = file_get_contents($file); echo “look in: $file\n”; foreach ($replace as $search_str => $replace_str) { echo ” for: $search_str\n replace with: $replace_str\n”; echo ” before: “.substr_count($contents, $search_str); $contents = str_replace($search_str, $replace_str, […]