I would warn against the generic search
and replace. You could end up getting a string in one of the
values that is the same as the prefix. The best route is through a
couple mysql commands:
SELECT CONCAT('ALTER TABLE ',db,'.',old_table,' RENAME
',db,'.',new_table,';') FROM
(
SELECT
table_schema db,
table_name old_table,
substr(table_name,4) new_table
FROM
information_schema.tables
WHERE
table_schema='{database_name}' AND
SUBSTR(table_name,1,3)='{prefix}'
) A
Change the {database_name} and {prefix} to the appropriate values.
This is set for a 3 character prefix (ie: d6_), so if it's a
different length then you need to adjust the substrs too. When you
run that it will generate a list of commands to rename each table.
Going from the command line, you can just pipe it to a text file,
or export the results in something like PHPMyAdmin. After that
just run the outputted file/commands and it will do all the
renaming for you. It is best to look at the commands it generates
first just to make sure it's renaming everything right (make sure
you have your substr lengths set right).
Jamie Holly
http://hollyit.net
On 11/8/2013 4:00 PM, Kevin Davison wrote:
Nancy, not a big deal. Besides using some
clever regex, you could just download the DB, open in a "robust"
text editor (BBEdit?), and search/replace away those prefixes...
then upload to replace.
Change your settings.php DB connection to exclude the
prefix. After that, it's best to use Drush to rebuild the
registry, clear cache, etc.