Wednesday, August 17, 2011

Using Git with a central repository

This is a nice write up on using Git with a central repository.  A good tutorial for newbies to Git.

Friday, August 12, 2011

Migrating User Guides

So you've got that awesome functionality built for your Drupal site...but the user doesn't know how to use it.

Welcome to Books and "User Guide Migration". For Drupal 6

How this came to be for me:
I needed to create some user guides, so I thought Book.  I needed this to run on a TEST server, because the users were learning here, and the LIVE server was not setup yet.  I needed to be able to migrate this content to the LIVE server without having to copy and paste.  I could not find a usable book export and import tool.  None of the ones I tried worked very well.  I tried the method below and was up and running in less than an hour (maybe it was less than 30 minutes...I don't remember).

First we need the modules:
  1. Book (standard in Drupal, but needs to be enabled)
  2. Deploy
  3. Services
At this point it is important to setup the Deploy and Services modules correctly.  I say correctly because the first time I did this, it didn't work.  The initial reason was that I used Drush to download the modules and I ended up getting a wrong version.  I believe I had to manually download and install the correct Services module to match Deploy.  Reading the documentation in the link above will get you the correct versions.  This was the only issue I came up with, but that was my fault.  :)

Reading the rest of the documentation will get your deployment and live server setup.  You need your deployment plan on your source server as well as authentication.  You also need authentication setup on your destination server.

Now create your book.  I won't go into the details about making a book, just add pages and modify the outline when necessary.
  1. Add your pages
  2. Change the outline where necessary
Now we are ready for pushing the content to your destination (LIVE) server.  You have your book setup on your source (or DEV or TEST) server or wherever, and now you need to go LIVE with it.

  1. Open the book, and you should see the option of Deploy. Select this.
  2. Select the Deployment Plan. In this example I am selecting the plan that was previously created.
  3. If successful, you should see a list of pages that are setup in your deployment plan.
  4. Repeat this process for EACH page in your book.  It's very easy to step through the book and then open the Deploy page in a new tab and do Step 2 later.

Now, you need to PUSH to your destination (LIVE) server.
  1. Go to Site Building,  Deployment, and you should see your list of deployments
  2. Select push
  3. Now select the Server you want to push to and the username/password fields should display.  Enter your credentials and click Push Deployment Plan.
  4. Magical wand...bells and whistles....everything should push to your destination server.
  5. Verify everything looks ok on the destination.
If you make updates to your book content, then a Push will get that to your live server.  This is awesome so that you can make changes, have it approved, and then push to your LIVE server.  Of course this approval process can be handled by workflow, but it's nice pushing and entire book (User Guide) at one time.  

Gotchas:
  • If you have images or other media in your book, they will not get pushed.  They need to be uploaded to the server.
  • Input Format: make sure the source and destination servers are setup with the same input formats.  This only needs to be done once of course.
  • After you have pushed, if you change the outline of your book and have added pages and messed around with it, it's possible to miss something.  You can still step through the book and add each page (even if it exists in your plan).  I have not found an issue with this yet.  NOTE TO SELF: It's best to remember to add the page to the deployment plan RIGHT AFTER you have created he page.