title: Best practices for Magento Deployment
body: <p>I am looking setting up a deployment process for a highly customized Magento site, and was wondering how other people do this. </p>
  
  <p>I will be setting up dev, UAT and prod environments. All the Magento files will be in source control (SVN). At this stage, I can't see any requirements for changing the DB, so the 3 databases will be manually maintained.</p>
  
  <p>Specifically,</p>
  
  <ul>
  <li>How do you apply Magento upgrades? (Individually in each env, or on dev then roll out, or just give up on upgrades?)</li>
  <li>What files/folders do leave alone in each environment (e.g. magento/app/etc/local.xml)</li>
  <li>Do you restrict developers to editing specific files/folders?</li>
  <li>Do you restrict theme designers to editing specific files/folders?</li>
  <li>How do you manage database changes?</li>
  </ul>
  
  <hr>
  
  <p><strong>Theme Designer Files/Folders</strong></p>
  
  <p>Designers can restricted to editing the following folders-</p>
  
  <pre><code>app/design/frontend/your_interface/your_theme/layout/
  app/design/frontend/your_interface/your_theme/template/
  app/design/frontend/your_interface/your_theme/locale/
  skin/frontend/your_interface/your_theme/
  </code></pre>
  
  <hr>
  
  <p><strong>Extension Developer Files/Folders</strong></p>
  
  <p>Extension developers can edit the following folders/files-</p>
  
  <pre><code>/app/code/local
  /app/etc/modules/&lt;Namespace&gt;_&lt;Module&gt;.xml
  </code></pre>
  
  <hr>
  
  <p><strong>Database environment management</strong></p>
  
  <p>As the store's base URL is stored in the database, you cannot just copy databases between environments. Options include-</p>
  
  <ul>
  <li>Overriding the base url in php. <a href="http://maglife.co.uk/2009/03/28/magento-base-urls-and-devstaging-installations/" rel="noreferrer">Blog
  article on setting up dev and staging
  databases</a></li>
  <li>Changing the base url in the database after copying. (<em>Where is this stored?</em>)</li>
  <li>Doing a MySQLDump or backup, then doing a replace on the URL in the SQL file.</li>
  </ul>