Best Practises For Drupal Maintenance

Directory Structure

Modules & Themes

modules & themes directories are for core Drupal - NEVER install into them

Sites Directory
Every file you add to your Drupal site should live in the ‘sites’ directory. ✔ This makes it easier to keep your site updated.

Sites All
✔ ✔

Modules used by multiple sites. Recommended in most cases.

Sites Default
✔ ✔ ✔

sites/default/modules - used by a single site.

Modules Sub-directories

Modules can be separated into sub directories for easier maintenance

Modules Management

Enable installed modules www.example.com/admin/modules

2. Go to Uninstall

1. Uncheck and save

Uninstall modules

Uninstall modules

Uninstall modules

Uninstall modules

2. Go to Updates 1. Updates are available

Update modules

Update modules

Update modules

Update modules

Update modules

Update modules

Update modules

Major Updates

Maintenance mode: take site off-line /admin/config/development/maintenance

Only users with permission able to access the site. User login page still accessable

Updating Drupal Core

✔ Update core

Features Updates

Moving Features
Live Server Live Stage

Development Server Dev Upgrade

Configuration
In:

• •

Code Database

Strategies
• try to keep changes in code
instead of database • keep code in version control • use Features and Strongarm • use Selenium to make small changes on dev, test on staging, then implement on live http://seleniumhq.org

Local Module
Local module to add small custom tweeks

Views In Module
Store Views in a module

• improves performance • easier to move (dev to live) • puts views in version control

Keep PHP Out Of The Database
• Easier to maintain code • Easier to find • Easier to upgrade • Under version control
If you must put PHP in a block, view, node.... put code in a function in your Local module then just call the function

Use Version Control
Enables code to be rolled back, and teams to work on same code

GIT http://git-scm.com/ ...

Questions

Image Credits
http://www.iconeden.com/icon/free/get/milky-a-free-vector-iconset http://www.flickr.com/photos/elyob/213880107 http://www.flickr.com/photos/evilerin/3078856253 http://www.flickr.com/photos/28796269@N05/3225819794 http://www.flickr.com/photos/egadapparel/3212007816 http://www.flickr.com/photos/wildcat_dunny/318732519/