Last updated April 22, 2011. Created on March 20, 2009.
Edited by katbailey, firebus, spidersilk, ngstigator. Log in to edit this page.

Deploy requires two servers

  • A source server (which you will be deploying from)
  • A destination server (which you will be deploying to)

While these do need to be separate and distinct Drupal installations, they do not actually need to be on two servers. They can be in separate subdirectories or virtual hosts on a single server and everything will work perfectly well. Two sites in a multi-site installation may work depending on the table sharing scenarios. This is beyond the scope of this guide.

Note: There is a different installation process depending on whether you are installing a new fresh install of Drupal on both servers or if you already have an existing site with lots of content that you want to split into "source" and "receiving" sites (a.k.a. "stage" and "live").

In either case, you'll want to make sure the servers have the same time, otherwise there may be synchronization issues. See http://www.cyberciti.biz/faq/howto-install-ntp-to-synchronize-server-clock/ for a nice set of instructions on installing the network time protocol (ntp) on CentOS, or search the internet for instructions for your OS.

Instructions for Fresh Drupal Install on Both Servers

Source server

  1. Download and extract the tarball for Deploy and Services into your modules directory. You must be using the most current -dev version (note: in the case of Services, you should be using the recommended release of 6.x-2.x, NOT 6.x-3.x-dev).
  2. Surf to /admin/build/modules on your site.
  3. Enable the following modules under the Deployment group:
    • Deployment
    • Node Deployment
    • User Deployment
    • UUID
  4. Go to admin/build/deploy/servers. Click 'Add a new server'.
  5. Enter 'Live Server' (or whatever you want to call your destination server) for the Name and 'http://your-destination-site.example.com/services/xmlrpc' for the URL field. (Replace "your-destination-site.example.com" with the domain of your actual destination server.) For Authentication type, choose "Session ID". Save the server information.

Destination Server

  1. Extract the tarball for Deploy and Services into your modules directory. You must be using the most current -dev version of both modules (note: in the case of Services, you should be using the recommended release of 6.x-2.x, NOT 6.x-3.x-dev).
  2. Surf to /admin/build/modules on your site.
  3. Enable the following modules:
    • Services (under the Services group)
    • Key Authentication (under the Services - authentication group)
    • XMLRPC Server (under Services - servers group)
    • System Service (under Services - services group
    • Node Service (under Services - services group
    • UUID Service (under Services - services group
    • User Service (under Services - services group)
    • UUID (under Deployment group)
  4. Go to admin/build/services/settings. Under 'Authentication module' choose 'Key authentication'. Make sure that 'Use sessid' is clicked and 'Use keys' is not (Deployment does not currently support API keys with Services.) Save the settings.
  5. Deployments run as a logged in user with the permissions of that user. For this test we will just use admin to keep things simple, but if you do not wish to use admin, you will need to configure permissions appropriately for the user you're planning on logging in as.

Instructions for Installing Using an Existing Drupal Site

In the following instructions, we assume your existing site will be the source server and that you will be setting up a copy of the site on the receiving server. (Don't set up the copy just yet -- read the instructions.)

Source Server

  1. Download and extract the tarballs for Deploy and Services into your modules directory. You must be using the most current -dev version (note: in the case of Services, you should be using the recommended release of 6.x-2.x, NOT 6.x-3.x-dev).
  2. Surf to /admin/build/modules on your site.
  3. Enable the modules:
    • Deployment (under the Deployment group),
    • Node Deployment,
    • User Deployment,
    • and UUID.
    • Key Authentication (under the Services - authentication group. If you don't see it, check to make sure you are using Services 6.x-2.x, not 6.x-3.x-dev)
  4. Go to admin/build/deploy/servers. Click 'Add a new server'.
  5. Enter 'Live Server' (or whatever you want to call your destination server) for the Name and 'http://your-destination-site.example.com/services/xmlrpc' for the URL field. (Replace "your-destination-site.example.com" with the domain that you will be using for your actual destination server.) For Authentication type, choose "Session ID". Save the server information.

Destination Server

  1. Make an exact copy of your source server's files and database and set them up on your destination server. It's important that you copy the database after you have set up Deploy on the source site. The database copy is best done using mysqldump of the source database (or an equivalent export utility depending on the type of database you're using) and then importing it into a fresh destination database. Be sure to modify your .htaccess and settings.php file on the destination server to reflect the new environment (like the new database name and login info.)
  2. Extract the tarball for Services into the modules directory for the receiving site. You must be using the most current -dev version of the module (note: you should be using the recommended release of 6.x-2.x, NOT 6.x-3.x-dev).
  3. Surf to /admin/build/modules on your site.
  4. Enable the following modules:
    • Services (under the Services group),
    • Key Authentication (under the Service - Authentication group. If you don't see it, check to make sure you are using Services 6.x-2.x, not 6.x-3.x-dev),
    • XMLRPC Server (under Services - servers group),
    • System Service, Node Service,
    • UUID Service,
    • and User Service (under Services - services group),
    • and UUID (under Deployment group).
  5. Go to admin/build/services/settings. Under 'Authentication module' choose 'Key authentication'. Make sure that 'Use sessid' is clicked and 'Use keys' is not (Deployment does not currently support API keys with Services.) Save the settings.
  6. Deployments run as a logged in user with the permissions of that user. For this test we will just use admin to keep things simple, but if you do not wish to use admin, you will need to configure permissions appropriately for the user you're planning on logging in as.

Now you can try deploying a new or updated node from the source server to the destination server. See "Basic Use" for more info.

Forbidden Error

If you get the error "Forbidden" during a deploy, you should check your destination server.
It turns out that on the destination server, in User Management > Permissions > services module > access services, you need to enable the "anonymous users" checkbox.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

isaac77’s picture

In the "Forbidden Error" section of the instructions above, there is a reference to the "access services" permission. I cannot find it on my install, and http://drupal.org/node/705042 indicates that this permission is no longer provided by the services module. I am new to deploy -- could someone more familiar update the docs (or correct me if I am mistaken)?

Thanks to all the contribs, this is an extremely important module!

jyg’s picture

Instructions for Installing Using an Existing Drupal Site

...

Source Server

...

5. Enter 'Live Server' for the Name and 'http://your-destination-site.example.com/services/xmlrpc' for the URL field. (Replace "your-destination-site.example.com" with the domain that you will be using for your actual destination server.) Save the server information. And set "Authentication type" to "Session id"

tutumlum’s picture

what if source server is in GMT +7 and destination server in GMT -6 ? It still works or not?

mattew’s picture

It should be noted that the offline mode on the destination server seems to block the deployment.

heyrocker’s picture

In offline mode services doesn't run

toulon’s picture

Version 6 requires that you "Add a New Deployment Plan" (admin/build/deploy/plans) before you can select anything to deploy.
You will then have to add your selected nodes to the plan you just created. Nodes are selected by clicking on the Deploy tab when the node is displayed.
Last you will need to push them. Open Deployment module (admin/build/deploy), select your plan by clicking on "push" next to your plan. You will prompted to select the destination server.