New setup

0. Prerequisite

Software stack:

1. Get Source

Do a git clone:

git clone gitosis@git.liip.ch:clients/<project>/drupal

Move into the drupal directory.

ONLY if you use Drupal 6 and if you don't have a local 'project-drupal-6' branch after the clone:

git checkout -b project-drupal-6 origin/project-drupal-6

Initialise the submodules:

git submodule update --init --recursive

Copy the file 'sites/default/default.settings.php' to 'sites/default/settings.php':

cp sites/default/default.settings.php sites/default/settings.php

Make sure the directory 'sites/default' is writeable by the webserver.

2. Prepare Database

create a database user in postgres:

createuser -P <username>

Note: if your system has a 'postgres' user you may have to change to that user first. As user 'root' do the following:

su - postgres

create a database in postgres:

createdb -E UTF-8 -O <username> <projectname>

3. Create Vhost

Create a simple vhost entry (example):

<VirtualHost *:80>
    ServerName <project>.lo

    DocumentRoot /home/<user>/liip/<project>/drupal
    CustomLog /var/log/apache2/<project>-access.log combined
    ErrorLog  /var/log/apache2/<project>-error.log

    <Directory /home/<user>/liip/<project>/drupal>
        Options +FollowSymlinks
    </Directory>
    php_value error_reporting 9999
</VirtualHost>

Restart apache and don't forget to add the ServerName to your hosts file.

4. Drupal install process

N. Keeping up to date

To synchronise your git repository:

git remote update
git rebase origin

After that you need to update your submodules:

git submodule init && git submodule update

Then you need to enable all of the modules listed in modules.enabled. One way to do that is with the following script.

drush en `paste -s -d ' ' modules.enabled`

For Upgrades after the initial installation do the following:

developer script to update local installation

The Drupal git developer script to update local install has a little script to update your local installation.

DB sync

To clone prod postgres database into your local postgres database you unfortunately cannot use "drush sync" since it uses mysqldump.

You will simplify such DB synching if you have identical database user database name on all instances (prod, staging, dev), with of course distinct and secure passwords.