drroot Posted March 17, 2012 Share Posted March 17, 2012 Could we do this from Back Office->Preference->Database? Otherwise what is the safe SQL command to change the database prefix? Is the following bash script correct and complete to apply on the dumped the sql database? #!/bin/sh # # Simple script for setting table prefixes in SQL-dump if [ $# != 2 ]; then cat >&2 << EOH Usage: $0 prefix original_db.sql >prefixed_db.sql - all tables will prefixed with 'prefix' EOH exit 1; fi PRFX=$1; sed "s/^CREATE TABLE /CREATE TABLE $PRFX/i; s/^INSERT INTO /INSERT INTO $PRFX/i; s/^REPLACE /REPLACE $PRFX/i; s/^ALTER TABLE /ALTER TABLE $PRFX/i" $2 Beside of modifying config/settings.inc.php, any other files to change? Link to comment Share on other sites More sharing options...
Rolige Posted March 17, 2012 Share Posted March 17, 2012 First nothing make a full backup Of you site. You can change right there and afrer need type the New prefix in file config/settings.inc.php Link to comment Share on other sites More sharing options...
drroot Posted March 18, 2012 Author Share Posted March 18, 2012 But there are lots of tables, need much of work of renaming... First nothing make a full backup Of you site. You can change right there and afrer need type the New prefix in file config/settings.inc.php Link to comment Share on other sites More sharing options...
Rolige Posted March 18, 2012 Share Posted March 18, 2012 But there are lots of tables, need much of work of renaming... Do this in your back office, exactly where you mentioned, Could we do this from Back Office->Preference->Database? and just do not forget to backup your database before, very important, Link to comment Share on other sites More sharing options...
drroot Posted March 18, 2012 Author Share Posted March 18, 2012 Do this in your back office, exactly where you mentioned, and just do not forget to backup your database before, very important, I tried, but it seems not working. It only changes the database prefix in file config/settings.inc.php Link to comment Share on other sites More sharing options...
Rolige Posted March 18, 2012 Share Posted March 18, 2012 I tried, but it seems not working. It only changes the database prefix in file config/settings.inc.php I think you need check all tables below, try again, if dont work maybe i can help u with some srcipt to change the prefix Link to comment Share on other sites More sharing options...
Recommended Posts