<div dir="ltr">Jamie, this is great! You&#39;re exactly right about this warning, and my assumption there was that the prefix would be entirely unique. Much better solution to use the mysql commands. -K</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Nov 8, 2013 at 3:40 PM, Jamie Holly <span dir="ltr">&lt;<a href="mailto:hovercrafter@earthlink.net" target="_blank">hovercrafter@earthlink.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 text="#000000" bgcolor="#FFFFFF">
    <div>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(&#39;ALTER TABLE &#39;,db,&#39;.&#39;,old_table,&#39; RENAME
      &#39;,db,&#39;.&#39;,new_table,&#39;;&#39;) FROM<br>
      (<br>
          SELECT<br>
              table_schema db,<br>
              table_name old_table,<br>
              substr(table_name,4) new_table<br>
          FROM<br>
              information_schema.tables<br>
          WHERE<br>
              table_schema=&#39;{database_name}&#39; AND<br>
              SUBSTR(table_name,1,3)=&#39;{prefix}&#39;<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&#39;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&#39;s renaming everything right (make sure
      you have your substr lengths set right). <br><span class="HOEnZb"><font color="#888888">
      <pre cols="72">Jamie Holly
<a href="http://hollyit.net" target="_blank">http://hollyit.net</a></pre></font></span><div><div class="h5">
      On 11/8/2013 4:00 PM, Kevin Davison wrote:<br>
    </div></div></div><div><div class="h5">
    <blockquote type="cite">
      <div dir="ltr">Nancy, not a big deal. Besides using some
        clever regex, you could just download the DB, open in a &quot;robust&quot;
        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&#39;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 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><font color="#888888"><br>
                      </font></span></span></div>
                <span><font color="#888888">
                    <div> </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 href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a>
            ]<br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
    </blockquote>
    <br>
  </div></div></div>

<br>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br></div>