<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Make Tech Easier&#187; table prefix</title>
	<atom:link href="http://maketecheasier.com/tag/table-prefix/feed" rel="self" type="application/rss+xml" />
	<link>http://maketecheasier.com</link>
	<description>Uncomplicating the complicated, making life easier</description>
	<lastBuildDate>Sun, 12 Feb 2012 15:58:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The Safe Way to Change your WordPress Database Table Prefix</title>
		<link>http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07</link>
		<comments>http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07#comments</comments>
		<pubDate>Sat, 07 Nov 2009 13:00:08 +0000</pubDate>
		<dc:creator>Damien</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[table prefix]]></category>

		<guid isPermaLink="false">http://maketecheasier.com/?p=8172</guid>
		<description><![CDATA[Unless you have make an attempt to change the table prefix before installing your WordPress blog, chances are that your WP database is still using the default &#8216;wp_&#8217; as the table prefix. With this default prefix, hackers can easily perform a SQL injection attacks on your database and wreak havoc to your site. The best [...]<p><div style="float:left;margin-bottom:10px"><a href="http://api.tweetmeme.com/share?url=http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07&amp;service=bit.ly" target="_blank"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07" style="border:none;margin-right:5px" width="51" height="61"></a><a href="http://digg.com/tools/diggthis/login?url=http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07" target="_blank"><img src="http://images.maketecheasier.com/diggme.png" style="border:none;margin-right:5px" ></a><a href="http://www.facebook.com/sharer.php?u=http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07" target="_blank"><img src="http://images.maketecheasier.com/fb.jpg" style="border:none;margin-right:5px" ></a><a href="http://www.google.com/reader/link?url=http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07&amp;title=The+Safe+Way+to+Change+your+WordPress+Database+Table+Prefix&amp;srcTitle=MakeTechEasier.com" target="_blank"><img src="http://images.maketecheasier.com/gbuzz-feed.png" style="border:none;margin-right:5px" ></a><a href="http://www.stumbleupon.com/submit?url=http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07" target="_blank"><img src="http://images.maketecheasier.com/stumble.png"></a></div>
<div style="clear:both"></div>
<strong><a href="http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07">The Safe Way to Change your WordPress Database Table Prefix</a></strong> originally published on <a href="http://maketecheasier.com">Make Tech Easier</a> (<a href="http://feedproxy.google.com/MakeTechEasier">RSS</a>)
<br/>
Follow us at <a href="http://www.facebook.com/MakeTechEasier">Facebook</a> | <a href="http://twitter.com/MakeTechEasier">Twitter</a></p>
]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-8211" title="tbl_prefix-wp-on-table" src="http://imagecdn.maketecheasier.com/2009/11/tbl_prefix-wp-on-table.jpg" alt="tbl_prefix-wp-on-table" width="200" height="133" />Unless you have make an attempt to change the table prefix before installing your WordPress blog, chances are that your WP database is still using the default &#8216;wp_&#8217; as the table prefix. With this default prefix, hackers can easily perform a SQL injection attacks on your database and wreak havoc to your site. The best way to prevent this from happening is to change the table prefix to another term that is difficult for hackers to guess.</p>
<p>If you are new to blogging and are looking to install your first WordPress blog, then it is easy. Simply change the <em>$table_prefix</em> entry in wp-config.php file, upload the file to the server, then proceed on with the <a href="http://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install" target="_blank">famous 5-mins installation</a>.</p>
<p>For those who have already been blogging for sometime, follow the method below to change your table prefix.<br />
<span id="more-8172"></span></p>
<h3>Preparation</h3>
<p>Download the following two plugins, install and activate them in your WordPress blog.</p>
<p><strong>WP-DBManager</strong> (<a href="http://wordpress.org/extend/plugins/wp-dbmanager/">plugin download page</a>)</p>
<p><strong>WordPress Table Rename</strong> (<a href="http://dl.getdropbox.com/u/149825/wordpress-table-rename.php.zip" target="_blank">modified version</a>,  <a href="http://www.seoegghead.com/software/wordpress-table-rename.seo" target="_blank">original download page</a>)</p>
<p>Note: I have make a slight modification to the WordPress Table Rename plugin to include changes in the later version of WordPress, but credit must be given to <a href="http://www.seoegghead.com/" target="_blank">SEO Egghead</a> for creating such an useful plugin.</p>
<h3>Get started</h3>
<p>Before you do anything to your database, first perform a db backup.</p>
<p>On the left pane, go to <em>Database –&gt; Backup DB. </em>Do a backup of your database.</p>
<p><img class="alignnone size-full wp-image-8174" title="tbl_prefix-backup-db" src="http://imagecdn.maketecheasier.com/2009/11/tbl_prefix-backup-db.png" alt="tbl_prefix-backup-db" width="577" height="319" /></p>
<p>Next, go to <em>Settings –&gt; Table Rename</em></p>
<p>Enter a new term for the table prefix.</p>
<p>Click the <em>Create New Tables</em> button to generate new tables with the new prefix. If you have a big database, this process will take a long time.</p>
<p><img class="alignnone size-full wp-image-8175" title="tbl_prefix-new-table" src="http://imagecdn.maketecheasier.com/2009/11/tbl_prefix-new-table.png" alt="tbl_prefix-new-table" width="479" height="260" /></p>
<p>When it is done, you will see the success message.</p>
<p><img class="alignnone size-full wp-image-8177" title="tbl_prefix-success-message" src="http://imagecdn.maketecheasier.com/2009/11/tbl_prefix-success-message.png" alt="tbl_prefix-success-message" width="577" height="168" /></p>
<p>If you have a big database, the page might issue a timeout and show a blank page.</p>
<h3>Verify your new database tables</h3>
<p>Now go to Database-&gt;database. You should see the new tables in place.</p>
<p><img class="alignnone size-full wp-image-8178" title="tbl_prefix-database-table" src="http://imagecdn.maketecheasier.com/2009/11/tbl_prefix-database-table.png" alt="tbl_prefix-database-table" width="577" height="498" /></p>
<h3>Migrating your blog</h3>
<p>While the plugin provides a way to change the table_prefix value in wp-config.php file, it won’t work in most cases unless you have set the wp-config.php file readable/writable (which I strongly advised against). The best way is to change the value manually.</p>
<p>With your favorite FTP program, download your wp-config.php from the root server.</p>
<p>Open it up with any text editor and scroll down to the section where you see</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$table_prefix</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'wp_'</span></pre></div></div>

<p>Change it to</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$table_prefix</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'YourNewPrefix_'</span></pre></div></div>

<p>Save it and re-upload this file back to the server.</p>
<h3>Almost there</h3>
<p>You have just completed the migration from the old table prefix to new table prefix, there are still several things that you need to do</p>
<p>1. Browse through your site and make sure all the pages, images and content are loading correctly. If you see errors, or that the site is not loading, change the <em>$table_prefix</em> back to &#8216;<em>wp_</em>&#8216; and re-upload back to the server.</p>
<p>2. Browse through the settings for each individual plugin and make sure that all the configurations are intact. Some of the plugins use the table prefix for their storage and these values were not changed by the plugin. For such plugins, you will see the settings fall back to their default values. What you have to do is to reconfigure it and re-save it. It will now store in the database with the new table prefix.</p>
<p>3. (Optional) Go to the <em>Database –&gt; Empty/Drop Tables</em>, check the <em>Drop</em> button for all the table with the old prefix. Click the Empty/Drop button to remove them from your database.</p>
<p><strong>Important</strong>: <em>Do this only if you are sure that the  new tables (with the new prefix) are working correctly.</em></p>
<p><img class="alignnone size-full wp-image-8179" title="tbl_prefix-delete-table" src="http://imagecdn.maketecheasier.com/2009/11/tbl_prefix-delete-table.png" alt="tbl_prefix-delete-table" width="580" height="714" /></p>
<p>Note that this is purely optional. Leaving your old table in the database will not hurt your blog and it can serve as a backup and allow you to switch back to them quickly in the event your blog got hacked into. However, if you have a big database, the extra tables could add plenty of overhead to your server. So, make your own judgement.</p>
<h3>Last part</h3>
<p>Once you are happy with everything, backup the new database. If you have previously schedule a daily backup, you have to reschedule it again to include the new tables.</p>
<p>You can also deactivate and uninstall the WordPress Table Rename plugin. There is no use for it now.</p>
<p>That’s it. You have successfully changed your WordPress database table prefix.</p>
<p>Image credit: <a href="http://www.flickr.com/photos/naokomc/" target="_blank">naokomc</a><br />
<!--adsense#468x60--></p>
<p><div style="float:left;margin-bottom:10px"><a href="http://api.tweetmeme.com/share?url=http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07&amp;service=bit.ly" target="_blank"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07" style="border:none;margin-right:5px" width="51" height="61"></a><a href="http://digg.com/tools/diggthis/login?url=http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07" target="_blank"><img src="http://images.maketecheasier.com/diggme.png" style="border:none;margin-right:5px" ></a><a href="http://www.facebook.com/sharer.php?u=http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07" target="_blank"><img src="http://images.maketecheasier.com/fb.jpg" style="border:none;margin-right:5px" ></a><a href="http://www.google.com/reader/link?url=http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07&amp;title=The+Safe+Way+to+Change+your+WordPress+Database+Table+Prefix&amp;srcTitle=MakeTechEasier.com" target="_blank"><img src="http://images.maketecheasier.com/gbuzz-feed.png" style="border:none;margin-right:5px" ></a><a href="http://www.stumbleupon.com/submit?url=http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07" target="_blank"><img src="http://images.maketecheasier.com/stumble.png"></a></div>
<div style="clear:both"></div>
<strong><a href="http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07">The Safe Way to Change your WordPress Database Table Prefix</a></strong> originally published on <a href="http://maketecheasier.com">Make Tech Easier</a> (<a href="http://feedproxy.google.com/MakeTechEasier">RSS</a>)
<br/>
Follow us at <a href="http://www.facebook.com/MakeTechEasier">Facebook</a> | <a href="http://twitter.com/MakeTechEasier">Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://maketecheasier.com/the-safe-way-to-change-your-wordpress-database-table-prefix/2009/11/07/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

