New setup
0. Prerequisite
Software stack:
- PHP
- Postgres
- Git
- Drush, the Drupal command line tool
- You can get it on the Drush website. You can also have it from homebrew
1. Get Source
Do a git clone:
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:
Initialise the submodules:
Copy the file 'sites/default/default.settings.php' to 'sites/default/settings.php':
Make sure the directory 'sites/default' is writeable by the webserver.
2. Prepare Database
create a database user in postgres:
Note: if your system has a 'postgres' user you may have to change to that user first. As user 'root' do the following:
create a database in postgres:
3. Create Vhost
Create a simple vhost entry (example):
Restart apache and don't forget to add the ServerName to your hosts file.
4. Drupal install process
- Call the URL of your new vhost to start intalling http://<project>.lo/. You should be redirected to http://<project>.lo/install.php.
- Select the standard installation profile
- Fix potential warning
- Configure your database
N. Keeping up to date
To synchronise your git repository:
After that you need to update your submodules:
Then you need to enable all of the modules listed in modules.enabled. One way to do that is with the following script.
For Upgrades after the initial installation do the following:
- enable all modules listed in modules.enabled
- visit http://.lo/update.php as administrator
or - run 'drush updatedb' in the document root of your installation
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.