<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">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:<br>
      <br>
      SELECT CONCAT('ALTER TABLE ',db,'.',old_table,' RENAME
      ',db,'.',new_table,';') FROM<br>
      (<br>
      &nbsp;&nbsp;&nbsp; SELECT<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; table_schema db,<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; table_name old_table,<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; substr(table_name,4) new_table<br>
      &nbsp;&nbsp;&nbsp; FROM<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; information_schema.tables<br>
      &nbsp;&nbsp;&nbsp; WHERE<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; table_schema='{database_name}' AND<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SUBSTR(table_name,1,3)='{prefix}'<br>
      ) A<br>
      <br>
      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). <br>
      <pre class="moz-signature" cols="72">Jamie Holly
<a class="moz-txt-link-freetext" href="http://hollyit.net">http://hollyit.net</a></pre>
      On 11/8/2013 4:00 PM, Kevin Davison wrote:<br>
    </div>
    <blockquote
cite="mid:CA+HZ7sfL2YDxH0oBGyKHsnyc1F33d5dZWT4743mvLrTm+zwwmA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Nancy, not a big deal. Besides using some
        clever&nbsp;regex, you could just download the DB, open in a "robust"
        text editor (BBEdit?), and search/replace away those prefixes...
        then upload to replace.
        <div>
          <br>
        </div>
        <div>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.</div>
        <div>
          <div><br>
          </div>
          <div>Kevin</div>
        </div>
      </div>
      <div class="gmail_extra">
        <br>
        <br>
        <div class="gmail_quote">On Fri, Nov 8, 2013 at 12:39 PM, Nancy
          Wichmann <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:nan_wich@bellsouth.net" target="_blank">nan_wich@bellsouth.net</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div>
              <div
                style="font-size:12pt;font-family:arial,helvetica,sans-serif">
                <div><span>I have inherited a site that was built in
                    India. Looking at the database, I see that they used
                    a database prefix. No, I have no idea why.</span></div>
                <div
style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br>
                  <span></span></div>
                <div
style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span>There
                    is a little bit of data in the non-prefixed tables,
                    although what I have looked at seems to be garbage.
                    For example, the non-prefixed node table is empty.</span></div>
                <div
style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br>
                  <span></span></div>
                <div
style="font-style:normal;font-size:16px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span>Does
                    anyone know an easy way to get rid of the prefix?
                    Are there any dangers in the straight-forward manual
                    process?<span class="HOEnZb"><font color="#888888"><br>
                      </font></span></span></div>
                <span class="HOEnZb"><font color="#888888">
                    <div>&nbsp;</div>
                    <div><font size="4" face="bookman old style, new
                        york, times, serif" color="#ff007f"><i><b>Nancy<br>
                          </b></i></font></div>
                  </font></span></div>
            </div>
            <br>
            --<br>
            [ Drupal support list | <a moz-do-not-send="true"
              href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a>
            ]<br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
  </body>
</html>