<?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>Martian Thoughts on Design &#187; Update</title>
	<atom:link href="http://blogs.martiangraphix.com/tag/update/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.martiangraphix.com</link>
	<description>Design, Web Development, and Interesting Technology</description>
	<lastBuildDate>Wed, 11 May 2011 03:32:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Updating Drupal Multi-Site on OS X</title>
		<link>http://blogs.martiangraphix.com/2010/03/updating-drupal-multisite-on-os-x/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=updating-drupal-multisite-on-os-x</link>
		<comments>http://blogs.martiangraphix.com/2010/03/updating-drupal-multisite-on-os-x/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 21:06:21 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Multi-Site]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Planet Drupal]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://blogs.martiangraphix.com/?p=189</guid>
		<description><![CDATA[We&#8217;re continuing on with the tutorials for the Drupal Multi-Site configuration that I set up on my Mac. All the domain and directory structure is based on that tutorial, so if you&#8217;ve done something slightly different, you&#8217;ll need to adjust as appropriate. Were following the basic procedure laid out in the UPGRADE.txt in your Drupal [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re continuing on with the tutorials for the <a href="http://blogs.martiangraphix.com/2009/09/building-a-drupal-development-environment-for-mac/">Drupal Multi-Site configuration</a> that I set up on my Mac.  All the domain and directory structure is based on that tutorial, so if you&#8217;ve done something slightly different, you&#8217;ll need to adjust as appropriate.</p>
<p><span id="more-189"></span>Were following the basic procedure laid out in the UPGRADE.txt in your Drupal core installation, so if you run into any problems you can get some additional tips there. </p>
<p>I&#8217;m writing a special tutorial on this because, when we set up our installation in the <a href="http://blogs.martiangraphix.com/2009/09/building-a-drupal-development-environment-for-mac/">Building A Drupal Development Environment page</a>, I set up some permissions on the <em>sites/</em> directory.  These permissions made it easier for us to access the files, but we&#8217;ll need to tweak a few things in the upgrade procedure to preserve these permissions.</p>
<p>So, in this tutorial, I&#8217;m going to show you step by step how to easily accomplish the upgrade.  </p>
<h2>Step 1: Log into your Drupal site as the administrative user</h2>
<p>Hopefully this is pretty self explanatory.</p>
<h2>Step 2: Set the site into maintenance mode</h2>
<p>Now, you&#8217;ll navigate to the <strong>Site maintenance</strong> page for the site, using the navigation links: <strong>Administer > Site configuration > Site maintenance</strong></p>
<h2>Step 3: Switch to one of the default themes</h2>
<p>If you&#8217;ve installed a custom theme, you&#8217;ll need to switch out to one of the ones that came with Drupal.  I&#8217;ll use Garland.</p>
<p>You get there by navigating to: <strong>Administer > Site building > Themes</strong>.</p>
<p>Make sure that Garland is <strong>Enabled</strong>, and that it is selected as the <strong>Default</strong>.  Save the configuration.</p>
<h2>Step 4: Disable any added modules</h2>
<p>We need to disable any modules that we&#8217;ve installed, which were not part of the Drupal Core.  Navigate to the modules page: <strong>Administer > Site building > Modules</strong></p>
<p>You do NOT need to disable anything in <strong>Core &#8211; required</strong> or <strong>Core &#8211; optional</strong>, but disable anything you see in the other section.  You can do this by unchecking the box in front of the module.  As you go through this, you&#8217;ll want to make a list of which modules you&#8217;re disabling, so you can turn these back on when we&#8217;re done.</p>
<p>When you&#8217;ve unchecked the modules, select <strong>Save configuration</strong> at the bottom of the list when done.</p>
<p>You may need to go through this several times to make sure all the modules are turned off, because some modules are required by others, and can&#8217;t be unchecked the first time through.  </p>
<h2>Step 5: Repeat Steps 1-4</h2>
<p>You&#8217;ll need to perform <strong>Steps 1-4</strong> for each site that you&#8217;ve installed.  You should be able to see all the sites you have by looking in your <em>~/Sites/drupal/6/sites/</em> folder.</p>
<p>Once you&#8217;ve gotten all your sites ready for upgrade, return here.</p>
<h2>Step 6: Backup the databases</h2>
<p>Now we need to make a backup of our databases.  We&#8217;ll start by opening the Terminal, and navigating to the our ~/Sites/drupal/ folder.  Once there, we&#8217;ll double check the name of our database.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span>
$ mysql <span style="color: #660033;">-u</span> yourrootaccount <span style="color: #660033;">-p</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;SHOW SCHEMAS&quot;</span></pre></div></div>

<p>Again, we&#8217;re using <em>yourrootaccount</em>, because I change the name of the root user on my databases as a simple security precaution.</p>
<p>Identify the database for the website, and we&#8217;ll back it up.  Following my previous examples, I&#8217;d need to backup &#8220;drupal_sandbox&#8221; and &#8220;drupal_essentials&#8221;, plus the other databases I&#8217;ve added.  To do this, do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysqldump <span style="color: #660033;">-u</span> yourrootuser <span style="color: #660033;">-p</span> <span style="color: #660033;">--databases</span> drupal_sandbox drupal_essentials <span style="color: #000000; font-weight: bold;">&gt;</span> drupal_20100301.sql</pre></div></div>

<p>Verify that the file looks correct:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
$ <span style="color: #c20cb9; font-weight: bold;">head</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">100</span> drupal_20100301.sql</pre></div></div>

<h2>Step 7: Download the latest version of Drupal</h2>
<p>You can get this from the <a href="http://drupal.org/project/drupal">Drupal Project Download</a> page.  At the time of this writing, Drupal 6.15 is the latest production build, so that&#8217;s what we&#8217;re using.</p>
<p>Download the file and move it into your <em>~Sites/drupal/</em> directory.  If your browser is set up to use your user&#8217;s <em>Downloads/</em> folder, switch back to the Terminal and perform the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">mv</span> drupal-<span style="color: #000000;">6.15</span>.tar.gz ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Verify that the file is in your <em>~/Sites/drupal/</em> folder.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span></pre></div></div>

<h2>Step 8: Rename the core directory</h2>
<p>We&#8217;re going to move our Drupal files directory to a new location as a backup.  We&#8217;re going to need our <em>sites/</em> folder later on.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000;">6</span> <span style="color: #000000;">6</span>_backup</pre></div></div>

<h2>Step 9: Install the new version of Drupal</h2>
<p>Now we&#8217;ll unpack the new version of Drupal that we downloaded in <strong>Step 7</strong>.  We&#8217;re also going to rename it to <em>6/</em>, as we had in our original installation.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzf</span> drupal-<span style="color: #000000;">6.15</span>.tar.gz
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> drupal-<span style="color: #000000;">6.15</span> <span style="color: #000000;">6</span></pre></div></div>

<h2>Step 10: Copy the old files back to the new installation</h2>
<p>Now we need to move all of our custom files back into the new directory. </p>
<p>To start with, we need to make sure we grab the cronall script we created in<a href="http://blogs.martiangraphix.com/2009/09/building-a-drupal-development-environment-for-mac/"> Building a Drupal development environment on Mac OS X</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000;">6</span>_backup<span style="color: #000000; font-weight: bold;">/</span>cronall.php <span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>If you&#8217;ve modified any other files, in Drupal&#8217;s core (e.g. .htaccess, robots.txt, or something in <em>themes/</em>), copy those into the <em>6/</em> folder now.</p>
<p>Now we&#8217;re at the step where we need to make sure to preserve the permissions for the webserver. In order to do this we&#8217;ll use the <strong>cp -Rp</strong> command.  You&#8217;ll need to make sure to include the <strong>sudo</strong> command in front of the copy command, or you&#8217;ll loose the permissions in the <em>sites/</em> folder.  So run the following in the Terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-Rp</span> <span style="color: #000000;">6</span>_backup<span style="color: #000000; font-weight: bold;">/</span>sites <span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Verify that the folders in sites still have the www group.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span> <span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>sites<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<h2>Step 11: Run the update</h2>
<p>Go back to your browser and run the update script:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">http://drupal6.local/update.php</pre></div></div>

<p>Follow the screen prompts, using the defaults.  You should select <strong>Continue</strong> and then <strong>Update</strong>, and the process will run automatically.  Select the <strong>Administration pages</strong> link at the end of the process.</p>
<h2>Step 12: Check the Status Report</h2>
<p>You&#8217;ll want to verify that the update process ran correctly by checking the status report.  Navigate to <strong>Administer > Reports > Status report</strong> and click <strong>run cron manually</strong>. </p>
<p>You should see the new version at the top of the table, and everything else should be green.</p>
<h2>Step 13: Restore your Modules</h2>
<p>Go back into the Modules page and restore your modules.  Navigate to the page by going to: <strong>Administer > Site building > Modules</strong></p>
<p>Using the list of modules you made in <strong>Step 4</strong>, select the check box in front of each module to turn it back on.  You should be able to select all the modules the first time through the screen.  When you&#8217;re done, select <strong>Save configuration</strong> at the bottom of the screen.</p>
<p>Once the configuration has been saved, you should get a yellow box at the top asking about new releases.  Select the <strong>check manually</strong> link in this box, to see if you need to update any of your modules.</p>
<p>If you get a message that says you need to update your modules, select the <strong>available updates</strong> link to see which modules need to be updated.  If all your modules are current, skip to <strong>Step 15</strong>.</p>
<h2>Step 14: Update your Modules</h2>
<p>From the <strong>Available updates</strong> page, select the <strong>Download</strong> link for each module that needs to be updated.  Copy the tar file into the <em>modules/</em> folder for this particular site.  For example, if it was the CCK module, you would do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">6</span>
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> ~<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>CCK-<span style="color: #000000;">6</span>.x-<span style="color: #000000;">2.1</span>.tar.gz sites<span style="color: #000000; font-weight: bold;">/</span>drupal6.local<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Now copy the existing module folder someplace else temporarily, and then unpack the new module.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> sites<span style="color: #000000; font-weight: bold;">/</span>drupal6.local<span style="color: #000000; font-weight: bold;">/</span>modules
$ <span style="color: #c20cb9; font-weight: bold;">mv</span> cck ~<span style="color: #000000; font-weight: bold;">/</span>Desktop<span style="color: #000000; font-weight: bold;">/</span>cck_backup
$ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzf</span> CCK-<span style="color: #000000;">6</span>.x-<span style="color: #000000;">2.1</span>.tar.gz</pre></div></div>

<p>Back in the browser, check that your updates are all correct, by refreshing the <strong>Available updates</strong> page.  Once you have all the correct versions of your modules, proceed to <strong>Step 15</strong>.</p>
<h2>Step 15: Restore your theme</h2>
<p>Return to the <strong>Themes</strong> page, by navigating to <strong>Administer > Site building > Themes</strong></p>
<p>Make sure your theme is <strong>Enabled</strong> and selected as the <strong>Default</strong>, and then select <strong>Save configuration</strong>. </p>
<h2>Step 16: Bring the site back online</h2>
<p>Now we need to reactivate the site.  Navigate to <strong>Administer > Site configuration > Site maintenance</strong> and set your site&#8217;s status to <strong>Online</strong>.</p>
<p>Then select <strong>Save configuration</strong> to reactivate the site.  Log out and go back to the <strong>Home</strong> page, to verify that your site is functioning correctly.  Navigate through some of your pages, to make sure everything looks OK.</p>
<h2>Step 17: Repeat Steps 12-16</h2>
<p>You&#8217;ll need to repeat <strong>Steps 12-16</strong> for each site that you&#8217;re maintaining.</p>
<p>Note: Sometimes an update will change some of the underlying database tables.  These changes can affect your modules, so you&#8217;ll need to make sure to run the status report on each site you have installed.  You may need to run the database update script on each site, before you can reactivate the modules.</p>
<p>That should be all you need to do.  Once you have checked through your sites, and everything looks to be running correctly, you can delete your backup folders.</p>
<p>Hopefuly you&#8217;ve found this tutorial useful.  Let me know if you run into any issues when running through this tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.martiangraphix.com/2010/03/updating-drupal-multisite-on-os-x/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

