Drupal Administration - jneubert/doc GitHub Wiki

Table of Contents

Drupal Installation

Drupal Core

  • für Projekt lokales Git-Repository als Clone von Drupal Core anlegen
  cd /opt
  git clone http://git.drupal.org/project/drupal.git labs
  • verfügbare Tags anzeigen
  git tag
  • aktuellste Version aktivieren
  git checkout 7.9
  • das Projekt-Repository als zentrales setzen
  git remote rename origin drupal
  remote add origin ssh://user@server/srv/git/labs.git
  • Projekt-Branch anlegen
  checkout -b labs
  • in das zentrale Projekt-Repository laden
  git push origin labs
  • Name+Email setzen
  git config --global user.name "Joachim Neubert"
  git config --global user.email "[email protected]"
  • ggf. farbige Anzeige setzen
  git config --global  color.ui "auto"

drush

drush 7

Composer install

mkdir /opt/drush7
cd /opt/drush7
composer require drush/drush:7.x
cd /usr/local/bin
ln -s /opt/drush7/vendor/bin/drush .

drush 8

DOES NOT WORK WITH POSTGRES DUE TO https://github.com/drush-ops/drush/issues/2079

See http://docs.drush.org/en/master/install/ (deprecated global install, Drush 8, compatible with Drupal 7, but requires >= 5.4.5):

cd /usr/local/bin
php -r "readfile('https://s3.amazonaws.com/files.drush.org/drush.phar');" > drush
  
# test install
php drush core-status
chmod +x drush

Maintenance scripts

backup_drupal.sh <instance> ["comment"]
Backup drupal installation and database.
reset_drupal.sh
Reset drupal instance to prior code and db state (edit and insert instance + backup directory to restore).
mk_drupal_base_inst.sh <instance>
Creates a drupal instance from a default installations saved filesystem and db.
update_drupal_inst.sh <instance> [--branch <branch>] [<tag>]
Update a drupal instance from git master branch (default), specified branch or tag.
mk_labs_testinst.sh <instance>
Creates a NEW development/test instance for cms drupal application from site alias (directory must be empty, database gets created/OVERRIDDEN).
recreate_drupal_dev.sh
Copies (OVERRIDES) the drupal filesystem and database from the @prod to the @dev instance (uses drush aliases)

Drupal quick&dirty test environment

Sets up very quickly a plain Drupal test environment with an own web server.

Directory for install: /tmp/drupal_qd/drupal. SQLite database /tmp/drupal_qd/drupal.sqlite

Install with projects (enables modules with the same name):

  drush -y qd drupal  \
    uuid entity deploy features  \
    --root=/tmp/drupal_qd/drupal  \
    --no-server  \
    --account-pass=secret

(The --enable parameter is not used because seems to prevent execution of dependency checking.)

Run server on an IP acessible from outside (without starting a browser locally):

  drush --root=/tmp/drupal_qd/drupal rs 192.168.56.12:8888  -

Features

Features can managed almost entirely via drush. Setting a version number and incrementing it can be done easily.

Create a feature via drush

Export an arbitrary component (e.g., dependencies:rdfx)

  drush fe labs --destination=sites/all/modules/custom --version-set=7.x-1.0 dependencies:rdfx

Add a component to a feature via drush

  drush fe labs --version-increment dependencies:uuid

Display available components

All components:

  drush fc '*'

Selected components:

  drush fc 'variable:*'
  drush fc '*:*labs*'

The feature(s), which provide a component already, are indicated.

Further drush commands

Drupal.org [Features](https://drupal.org/node/960926)

Konfiguration Mehrsprachigkeit

für den Entity Translation Ansatz:

  • Module (gem. Anleitung) runterladen und installieren
  • Node und Taxonomy in Entity Translation Config aktivieren
  • add permission "Translate entities of type Taxonomy term"
  • Beim content type
    • multilingual "Enabled, with entity translation" aktivieren
    • in Manage Fields bei "title" replace anklicken
  • bei taxonomy xyz
    • magage fields, replace name and description

Benutzersprache

default auf (angezeigt) "Englisch" stehen lassen reicht nicht, man muss die Sprache einmal explizit speichern

div

Reset Admin Password

  drush user-password username --password="new_password"

nach Recovering your Drupal 7 administrator account password

⚠️ **GitHub.com Fallback** ⚠️