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

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


• •

Code Database

• 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

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 ...


Image Credits