<?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>Justin's Blog &#187; move wordpress</title>
	<atom:link href="http://www.justinsblog.com/tag/move-wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.justinsblog.com</link>
	<description>Life - Domain Names - Internet - Reviews - Helpful Information</description>
	<lastBuildDate>Fri, 15 Jan 2010 23:54:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Move WordPress to New Domain</title>
		<link>http://www.justinsblog.com/2009/04/30/how-to-move-wordpress-to-new-domain/</link>
		<comments>http://www.justinsblog.com/2009/04/30/how-to-move-wordpress-to-new-domain/#comments</comments>
		<pubDate>Fri, 01 May 2009 00:14:03 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[move wordpress]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.justinsblog.com/?p=145</guid>
		<description><![CDATA[
Have you ever thought about moving your WordPress website?  Better yet, have you ever thought of creating a duplicate or backup of your WordPress website to use as a clone for reproduction?
If you are a webmaster or domainer, chances are you&#8217;ve heard of WordPress and have possibly used it and if you&#8217;ve been around a [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-176 aligncenter" title="How to Move your WordPress blog" src="http://www.justinsblog.com/wp-content/uploads/2009/04/movewpblog.jpg" alt="Moving WordPress to a new domain" width="480" height="160" /></p>
<p>Have you ever thought about moving your WordPress website?  Better yet, have you ever thought of creating a duplicate or backup of your WordPress website to use as a clone for reproduction?</p>
<p>If you are a webmaster or domainer, chances are you&#8217;ve heard of WordPress and have possibly used it and if you&#8217;ve been around a while, you may even have several or many WordPress sites up an running.  Either way, at some point you may want to move or copy your website so let&#8217;s get going.    <span id="more-145"></span></p>
<h2>Moving WordPress</h2>
<p>WordPress consists of two major components which make up an actual website, data and files.</p>
<ol>
<li><strong>Database </strong>- is a database of tables that stores all of the content of your website.  This will contain every stitch of content on your website including users, links, basically everything.</li>
<li><strong>Files</strong> &#8211; These are the actual files and directories (folders) stored on the server of your host.  A file manager is where you&#8217;ll find these.  Files are what makes your website look like it does and communicate with the database to display your website information within the confines of css and templates.</li>
</ol>
<p>In my case, I have a small business website where I installed a bare bones, WordPress 2.7.1 with nothing but Maintenance Mode installed and a customized temporary landing page.  The objective is to duplicate or copy my website onto another domain name to save time.  Some may do this differently but I&#8217;m going to list my steps below how I do it.</p>
<h3>Seven Quick Steps to moving your WordPress site:</h3>
<ol>
<li>Backup database tables</li>
<li>Backup and download WordPress files</li>
<li>Upload WordPress backup .tar file to new location</li>
<li>Change wp-config file (database access)</li>
<li>Import tables to new database</li>
<li>Run mySQL queries in phpMyAdmin</li>
<li>Update WordPress General settings</li>
</ol>
<h3><span style="color: #800000;">Step 1</span> &#8211; Backup WordPress database</h3>
<p>While there are of course, many ways to do this I prefer going right into phpMyAdmin in cpanel and clicking on my wordpress database and then clicking on export and making sure all the tables are selected.  I use the &#8220;zipped&#8221; compression level and save it to a folder on my hard drive.  I like to call mine, Site Recipes.  So now I have a backup of the basic tables within database, now what?</p>
<h3><span style="color: #800000;">Step 2</span> &#8211; Backup WordPress files</h3>
<ol>
<li>Go into File Manager and to the directory where WordPress is installed.</li>
<li>Select All the files &#8211; Usually there&#8217;s a checkbox.</li>
<li>Compress Files &#8211; in cpanelX theme there is button for that.  I use the .tar selection when it prompts me.</li>
<li>Download the file you just compressed into the same folder as your database tables.</li>
</ol>
<blockquote><p>Now that I have both a database backup and a file backup we&#8217;re going to have to put these both on the new server.  There are a couple things that you should have completed in order to move your website&#8230; like a new host or a new cpanel account or simply a sub-directory or add-on domain.  In my case, I&#8217;m moving this WordPress site from domain &#8216;A&#8217; to domain &#8216;B&#8217; so I have the necessary elements already set up.  These are my Cpanel hosting account and I&#8217;ve created a database with username and password.</p></blockquote>
<h3><span style="color: #800000;">Step 3 </span>- Upload and Extract WordPress Tarball to location</h3>
<p>Do not extract that .tar file you downloaded, simply use an ftp program or cpanel to upload it to your new domain where you&#8217;ll be moving the site.  On my hosting account with Hostgator, my files are stored in the /public_html/ directory.  This is the web accessible directory, (when you go to www.yoursite.com it automatically takes you to the /public_html/ directory on your server.  In there it&#8217;s going to look for an index file.   So upload that backup to the location of your new website and extract it there.</p>
<p>In cpanelX 11, you can do this within cpanel.  Just select the file and extract it to the location on your server that it was uploaded to, change nothing.  We uploaded to /public_html and that&#8217;s where we will extract it.</p>
<h3><span style="color: #800000;">Step 4</span> &#8211; Change wp-config</h3>
<p>There are three things in the wp-config.php file you&#8217;ll want to change, (This file is located in the directory you unzipped the wordpress backup in.  The three changes are: (in bold)</p>
<blockquote><p>/** The name of the database for WordPress */<br />
define(&#8216;DB_NAME&#8217;, &#8216;<strong>cpaneluser</strong>_<strong>databasename</strong>&#8216;);</p>
<p>/** MySQL database username */<br />
define(&#8216;DB_USER&#8217;, &#8216;<strong>cpaneluser</strong>_<strong>username</strong>&#8216;);</p>
<p>/** MySQL database password */<br />
define(&#8216;DB_PASSWORD&#8217;, &#8216;<strong>DatabasePassword</strong>&#8216;);</p></blockquote>
<p><strong>Cpaneluser</strong> &#8211; refers to your cpanel user login name which is a prefix followed by an underscore then the database name and username.  This information is needed to communicate with the database.</p>
<h3><span style="color: #800000;">Step 5</span> &#8211; Import the WordPress Database Tables</h3>
<p>Now that we have the files and all have been uploaded and extracted and we have configured the WordPress files to communicate with your database, we must now populate the database with the tables we saved from our site recipe or site backup.  Once we have the new database tables in place we&#8217;re going to have to run some database queries using the MySQL replace() function to change links within the database.  You&#8217;ll need to stay in phpMyAdmin to do this step.</p>
<h3><span style="color: #800000;">Step 6</span> &#8211; Run MySQL Queries to Change the WP Database Links</h3>
<p>First SQL querie we&#8217;re going to run is replacing the siteURL in the database.  Rather than looking for the exact table, just select the database we added tables to and select the 2nd tab, SQL.</p>
<blockquote><p><span style="color: #008000;">UPDATE wp_options SET option_value = replace(option_value, &#8216;http://www.old-domain.com&#8217;, &#8216;http://www.new-domain.com&#8217;) WHERE option_name = &#8216;home&#8217; OR option_name = &#8217;siteurl&#8217;;</span></p></blockquote>
<p>The next database querie we will run is going to replace the URLs within the WordPress posts and pages and stored in wp_posts.  Here is the querie:</p>
<blockquote><p><span style="color: #008000;">UPDATE wp_posts SET guid = replace(guid, &#8216;http://www.old-domain.com&#8217;,'http://www.new-domain.com&#8217;);</span></p></blockquote>
<p><span style="color: #000000;">Again, simply replace the old-domain with your new domain name leaving everything else in tact.  The last querie we will run is going to replace links within posts or internal links.</span></p>
<blockquote><p><span style="color: #008000;">UPDATE wp_posts SET post_content = replace(post_content, &#8216;http://www.old-domain.com&#8217;, &#8216;http://www.new-domain.com&#8217;);</span></p></blockquote>
<p><span style="color: #000000;">Now that all the links are changed within wordpress, we are almost done.</span></p>
<h3><span style="color: #000000;"><span style="color: #800000;">Step 7</span> &#8211; Change your WordPress General Settings</span></h3>
<p><span style="color: #000000;">Login to your WordPress now under:   yourdomain.com/wp-admin and go to settings, general and change the information in there including your email address and the name of your website.</span></p>
<p><span style="color: #000000;">That&#8217;s it!  Your new wordpress site should be up and running.  Below are several links to other methods of moving your wordpress website that you may find helpful.</span></p>
<ul>
<li><a title="Moving hosted Wordpress to another domain in 9 easy steps" href="http://www.riazkanani.com/archive/2009/04/01/moving-hosted-wordpress-to-another-domain-in-9-easy-steps/" target="_blank">Moving WordPress to another domain 9 steps</a></li>
<li><a title="Moving Wordpress To A Different Domain" rel="bookmark" href="http://www.webdevelopment2.com/moving-wordpress-to-a-different-domain/" target="_blank">Moving Wordpress To A Different Domain</a></li>
<li><a title="How to move WordPress with no downtime" href="http://www.prelovac.com/vladimir/how-to-move-wordpress-site-to-another-server-with-zero-downtime" target="_blank">How to move WordPress site to another server with zero downtime</a></li>
<li><a title="Moving Wordpress To A Different Domain" href="http://www.webdevelopment2.com/moving-wordpress-to-a-different-domain/" target="_blank">Moving WordPress to a Different Domain</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.justinsblog.com/2009/04/30/how-to-move-wordpress-to-new-domain/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
