Drupal maintenance support plans Bits at Web-Dev: Hook Update Deploy Tools: Node import FAQs

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

How do I export and import nodes using Hook Update Deploy Tools? >> Read the project page or a quick how-to.
What is the unique ID that connects an export to an import?
What are the risks of this import export model?
What if I am using an entity reference or a taxonomy that does not exist on production?
Does the import show up as a revision?
What happens if the import does not validate?
What if the alias or path is already in use by another node?
What if the alias or path is already in use by a View or used by a menu router?
Is there a limit to the number of nodes that can be imported this way?

What is the unique ID that connects an export to an import?
To create the export file, the node id is used to create the file.  After that, the filename and ‘unique id’ references the alias of that node.  So when you import the node, the node id on the production site will be determined by looking up the alias of the node.  If a matching alias is found, that is the node that gets updated.  If no matching alias is found, a new node gets created.  The alias becomes the unique id.
What are the risks of this import export model?
At present the known risks are:

If the exported node uses entity references that do not exist on prod, the entity reference will either not be made, or reference an entity that is using that entity id on prod.  This can be mitigated by exporting your source node while using a recent copy of the production DB.
If the exported node uses taxonomy terms that do not exist on prod, the tag may import incorrectly. This can be mitigated by exporting your source node while using a recent copy of the production DB.
if you are using pathato and the existing pattern on the production site is different than the pattern on your sandbox.  The imported node will end up with a different alias, resulting in an invalid import.  The imported node will be deleted since it failed validation and the hook_update_N will fail. This can be mitigated by exporting your source node while using a recent copy of the production DB.
File attachments.  There is currently not a way to bring attached files along with them unless the files already exist with a matching fid on production.

What if I am using an entity reference or a taxonomy that does not exist on production?
See answers 1 and 2 in What are the risks of this import export model?
Does the import show up as a revision?
Yes it does, and the revison note contains the imported note, but also indicates it was imported with Hook Update Deploy Tools.  The revision will take on the status of the exported node.  If the exported node was unpublished, the impoirted revision will be unpublished.
What happens if the import does not validate?
If the import was to an existing node, the update revision wil be deleted and return the node to its last published revision.  If the import was for a node that did not exist on the site, the node and its first revision will be deleted.  In either case, if the import was run through a hook_update_N, that update will fail and allow it to be re-run once the issue is resolved.
What if the alias or path is already in use by another node?
If the alias is in use by a node, that node will be updated by the import.  The alias is the unique id that links them not the nid.
What if the alias or path is already in use by a View or used by a menu router?
If the alias is in use on the site by something other than a node, the import will be prevented.  If the import is being run by a hook_update_N() then the update will fail and can be run when the issue is resolved.
Is there a limit to the number of nodes that can be imported this way?
Technically, there is no real limit.  Realistically, it is not a great workflow to move all of your content this way.  It is not a good workflow.  This export import method is best reserved for mission critical pages like forms or thankyou pages that go along with a Feature deployment.  It is also good for pages that often get destroyed during early site development like style guides and example pages.

Source: New feed

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Drupal maintenance support plans Bits at Web-Dev: Hook Update Deploy Tools: Node import FAQs

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.