Drupal 7

Hook Update Deploy Tools: Node import FAQs

Using the Drupal module Hook Update Deploy Tools to move node content  can be an important part to a deployment strategy. 

Import nodes as part of deployment using Hook Update Deploy Tools

With the 7.x-1.18 release of Hook Update Deploy Tools for Drupal 7 it is now possible to export a node on a development sandbox, commit the export file to the repository, then import it using either a hook_update_N() or using drush site-deploy-import node

Pros:

Drupal file_scan_directory option nomask

Other than a quick sample of blocking a specific file extension using the 'nomask' option, the documenttation for Drupal's file_scan_directory() does not help much with how to bock content from certain directories.  The documentation says

Drupal: Enable or Disable a View in Deployment.

Drupal Hook Update Deploy Tools now (as of v 7.x-1.16) has the ability to enable or disable  a View from within a hook_update_N().  It handles validation to make sure that your request to enable or disable a View actually did what you asked it to do.

 

Add something like this to a hook_update_N in your custom deploy module.install
to enable some Views.

Deploy or Import Drupal Redirects with Hook Update Deploy Tools

The Hook Update Deploy Tools module  can now programatically import a list of redirects in a hook_update_N().  The redirect list comes from a csv text file that lists old-path, new-path on each line.  Running the import in an update hook is as simple as something like this:

Deploy Drupal Page Manager Pages - Hands Free

Page Manager pages in Drupal 7 are an odd mixture of configuration and content. They can be Featurized, but then if someone edits the content on the live site, the next time the Feature gets reverted, the content changes get blown away. So in many cases the deployment of Page Manager Pages consists of exporting them by hand, then importing them by hand. Until NOW.

Look Ma, No Hands Drupal Deployment

This presentation was given at the 2016 Florida Drupalcamp in Orlando on 5/05/2016. It covers my experience and recommendations for how to do continuous integration or continuous deployment with Drupal 7 websites and the role played by hook_update_N() to orchestrate code and configuration changes with releases.

D7: Make a Custom Site Deploy Module with One Drush Command

Thanks to the writing and efforts of Dcycle, Befused and others, there is a lot of good information out there on why and how to use a custom deploy module in Drupal 7 to manage the deployments of code and settings on your websites.  They describe them pretty clearly and make it a simple process to copy and paste  bits of code to assemble your own custom deploy module.  What could be wasier than that?

D7: Export and Import Rules with Hook Update Deploy Tools

In Drupal 7, Features is one option for deploying Rules and changes to them.  Now there is another alternative.  As of version 7.x-1.10 of Hook Update Deploy Tools, the module adds the ability to use Drush to export an existing rule from a development server, commit it to version control, then deploy it to a production server using hook_update_N().

Of course being a method from HookUpdateDeployTools, it brings with it the standards of the module:

hook_geocoder_geocode_values_alter()

If you are using the geocoder module in Drupal 7 and you need the opportunity to alter the data being geocoded right before it gets sent to whichever geocoding service you are using, there is a hook for that. The hook is pretty much undocumented at this time, but it is there. hook_geocoder_geocode_values_alter() is available for you if you need it.

Pages

Subscribe to RSS - Drupal 7