How to develop Drupal sites with Xplain Hosting

Xplain Hosting assumes a particular way of working. If you follow that, you will get the most out of our services. A short summary:

Summary

  1. We assume developers develop locally on their machine by checking out the staging site.
  2. All development is committed to the staging site. Tester and the customer use the staging site to verify functionality.
  3. If functionality is ready for the live site, the staging site is merged into the live site. No development takes place against the live site: no code is ever committed against the live site, no modules are installed on the live site, which are not installed on the live site first.

Introduction

We assume three different environments: locally on a developer machine, the staging, and the live site.

This model will break if you install modules directly on the live site. So do not use the Drupal module manager to install or upgrade modules, or even Drupal itself. You will never need to upgrade Drupal itself, that will be done by Xplain Hosting. If you need to upgrade modules, you do that locally on the developer machine, test it, and then commit it. Or do it on the staging site, and then commit it. Do not use the Drupal module manager, it does not work with SVN.

The development environment

all your sites are listed on the control panel. To get a site on your local development environment, you will need to check it out using subversion. You can use svn or git subversion.

Instructions on checking out a site are found on the info tab of a site. Either click on a site, and next to go to the info tab, or click on the info link behind a site on the control panel. Note the info tab contains different information for either the staging or live site.

You can add new modules locally, and add them using svn's svn add. Faster is using our Drupal module manager. Go to the control panel for your staging site, and click the Drupal module manager. The first tab will show modules which need upgrading, the second contains the most popular modules. Tick the modules you want to have, and after a few minutes they will have been added. Simply checkout your site locally again to receive the updates.

You can upload files to sites/default/files using rsync or scp.

Do not add files under sites/default/files to svn. Do also not add settings.php to svn. These are site specific settings and often different between staging and live sites.

The staging environment

In the staging environment you find the Drupal module manager to quickly upgrade modules or install new ones.

You can also copy the live database to staging with a single click.

The live environment

On the live site you will find the merge from staging button. Use this to copy checked-in changes from staging to live.

Another useful button is to copy new files from the staging sites/default/files to the live sites/default/files.

Setup cron

Click on the domain settings button to change various settings for your site. You can for example increase or decrease cron frequency.