Deployment Module Installation and Usage

NOTE: These instructions apply to the 5.x version of Deploy, which is out of date and no longer used. To learn how to install and setup the 6.x version of Deploy, please refer to http://drupal.org/node/408774.

Requirements

This framework requires two servers

  • Source server (which you will be deploying from)
  • Destination server (which you will be deploying to)

Both servers should have a Drupal installation up and running. Deployment currently only supports Drupal 5. In order for deployments to work, your source server must be able to reach your destination server on port 80.

If you have a previously installed version of the Deployment module, you will need to run update.php as there have been some schema changes.

Deployment requires the usage of a Services API Key. This is currently the only reliable means of securing the Services module from a remote Drupal installation, therefore Deployment will not work without it. Deployment does not currently support the use of Session IDs with Services, as this functionality does not currently work with clients that don't support cookies (like Drupal's XMLRPC client).

Destination Server Setup

  1. Download and unpack the Services module into your modules directory. Note that Deployment requires the most recent dev snapshot of Services, so if you have an older version you should probably update it.
  2. Download and unpack the Deployment module into your modules directory.
  3. Surf to your module installation page (Administer -> Site Building -> Modules) and enable Services (under the Services group), XMLRPC Server (under Services - servers group), Content Copy Service, Views Service and/or System Settings Service (under the Services - services group) depending on your need.
  4. Surf to the Services configuration page (Administer -> Site Building -> Services -> Settings tab).
  5. Under the Services Security tab, Verify that "Use Keys" is checked, and "Use Sessid" is unchecked
    (Deployment does not currently support using sessions with services).
  6. If you do not already have an API Key generated for this server, you can create one under the Services Keys tab. An API key is required for Deployment.

Source Server Setup

  1. Download and unpack the Deployment module into your modules directory.
  2. Surf to your module installation page (Administer -> Site Building -> Modules) and enable the Deployment (under the Deployment group) as well as Deploy System Settings, Deploy Views, and/or Deploy Content Type depending on your needs.

Usage

  1. Surf to the Deployment page (Administer -> Site Building -> Deployment) and click "Add a new deployment plan". A deployment plan needs is just a name by which you can identify it and an optional description. Enter this data and submit the form. You should be returned to the deployment plan listing with your plan listed.
  2. Click the Servers tab and click "Add a new server". You will need to enter a name for the server, a path to the destination server's XMLRPC Server implementation (usually http:///services/xmlrpc) and the destination server's API Key as created in the installation instructions. Submit the form.
  3. Add items to deploy
    • If you have enabled Content Copy Deployment - Surf to Administer -> Content -> Content Types. Click the "Deploy" tab. Choose a deployment plan and content type(s) you want to export. Submit the form. If the content type in question already exists on the destination server, it will be updated.
    • If you have enabled System Settings Deployment - Surf to a configuration page that implements system_settings_form (Most module and core settings pages uses this functionality. For example Administer -> Site Configuration -> Date and Time). At the bottom of the form you can choose a deployment plan. Choose one and submit the form.
    • If you have enabled Views Deployment - Surf to Administer -> Build -> Views. Click the "Deploy" tab. Choose a deployment plan and the view(s) you want to export. Submit the form. If the view in question already exists on the destination server, it will be updated.
  4. Return to Administer -> Build -> Deployment and click the name of your deployment plan. You should see the items above listed. Items are deployed from top to bottom in this list. In some cases you may need to change the ordering of the items you're deploying because of dependincies. For instance, your Article content type may contain a nodereference to your Author content type. In this case you want to force Author to be deployed first. Another example would be your want your Pathauto settings to be deployed after all your content types, because it may reference them. When you have your items weighted as needed, save the form.
  5. Click Push under Operations. You will be asked to choose a destination server from the ones you've setup. Choose the appropriate server and submit the form. Your items will now be pushed to their destination.
  6. Once the push is complete, you will be shown a list of the items pushed and their results, as well as any associated error messages. Note that if one item in your push fails due to an error, the rest of the plan will be skipped. This is to prevent items from being pushed when their dependencies have failed. The results of past deployments can be viewed on the Logs tab under Administer -> Site Building -> Deployment.
  7. In theory you should now be able to go to your destination server and your settings/content types should appear there.

Permissions

Three user permissions are available to control access to Deployment-related functions.

  • Administer Deployment - User can add/edit/delete plans and servers, and view logs of past deployments.
  • Add Items To Deployment Plan - User can add content types, views, and system settings to a deployment plan
  • Deploy Items - User can push deployments to destination servers

Caveats

  • If there is no Deploy tab on the Content Types or Views pages, it is likely because either a) you did not enable the appropriate module or b) you have not created any deployment plans.
  • The appropriate modules must be enabled on the destination server (for instance, a content type push will fail if Content Copy is not enabled on the destination server) and in some cases this could be version-dependent. I plan to write more advanced dependency checking in the future. There is currently a Services call available to check the version of a module on a remote server, if anyone is feeling frisky and wants to write a patch.
  • Content Copy has some bugs which prevent some content types from being imported properly. These content types will also fail when being deployed. If you can Export and then Import a content type, then it will work here too.