Skip to content

Installation Guide

This guide provides detailed instructions for installing and setting up the Knowledge module on your Drupal site.

Prerequisites

Before installing the Knowledge module, ensure your Drupal site meets these requirements:

System Requirements

  • Drupal: 10.3 or higher, 11.x, or 12.x
  • PHP: 8.3 or higher
  • MySQL: 5.7.8+ or MariaDB 10.3.7+ (standard Drupal requirements)
  • Composer: Required for dependency management

While not required, these modules enhance the Knowledge module's functionality:

  • Views UI: For creating custom reports (Drupal core, usually enabled)
  • Field UI: For configuring knowledge fields and types (Drupal core)
  • LDAP: Required only if using Knowledge LDAP submodule
  • Search API: Already required, but configure for better knowledge search

Installation Methods

Composer is the recommended installation method as it automatically manages dependencies.

Step 1: Require the Module

From your Drupal root directory:

composer require drupal/knowledge

This command: - Downloads the Knowledge module - Downloads all required dependencies - Updates your composer.json and composer.lock files

Step 2: Enable the Module

Using Drush:

drush en knowledge -y

Or using Drupal Admin UI:

  1. Navigate to Extend (/admin/modules)
  2. Find "Knowledge" in the module list
  3. Check the box next to it
  4. Click "Install" at the bottom of the page
  5. Wait for installation to complete

Step 3: Verify Installation

Run this command to verify the module is enabled:

drush pm:list --type=module --status=enabled | grep knowledge

You should see: - Knowledge (knowledge) - Knowledge fields (knowledge_field)

Method 2: Manual Installation

If you cannot use Composer, follow these steps:

Step 1: Download Dependencies

You must manually download and install these modules first:

  1. Autocomplete ID (^1.5): https://www.drupal.org/project/autocomplete_id
  2. Charts (^5.0): https://www.drupal.org/project/charts
  3. Moderation Note (^1.0-beta5): https://www.drupal.org/project/moderation_note
  4. Search API (^1.0): https://www.drupal.org/project/search_api
  5. Token (^1.13): https://www.drupal.org/project/token

Extract each module to your modules/contrib directory.

Step 2: Download Knowledge Module

  1. Download the Knowledge module from https://www.drupal.org/project/knowledge
  2. Extract to modules/contrib/knowledge
  3. Ensure the directory structure is:
    modules/contrib/knowledge/
      knowledge.info.yml
      knowledge.module
      src/
      modules/
      ...
    

Step 3: Enable Required Modules

Enable dependencies first, then the Knowledge module:

drush en autocomplete_id charts moderation_note search_api token -y
drush en knowledge -y

Or use the admin UI at /admin/modules.

Method 3: Development Installation

For developers or contributors:

Step 1: Clone the Repository

cd modules/custom
git clone https://git.drupalcode.org/project/knowledge.git
cd knowledge

Step 2: Install Dependencies

composer install

Step 3: Enable the Module

drush en knowledge -y

Post-Installation Configuration

After installing the module, complete these setup steps:

Step 1: Verify Permissions

  1. Navigate to People > Permissions (/admin/people/permissions)
  2. Scroll to the "Knowledge" section
  3. Assign appropriate permissions to your roles
  4. Recommended starting permissions:

For Authenticated Users: - Access knowledge - Post knowledge - Edit own knowledge - View own competency

For Content Editors: - Access knowledge - Post knowledge - Skip knowledge approval - Edit own knowledge - View own competency

For Administrators: - Administer knowledge - Administer knowledge types - Access knowledge reports

Click "Save permissions"

Step 2: Create Your First Knowledge Type

  1. Navigate to Structure > Knowledge > Link (/admin/structure/knowledge/link)
  2. Click "Add knowledge type"
  3. Fill in:
  4. Label: "Support Ticket to Article" (or your use case)
  5. Description: "Links support tickets to help articles"
  6. Target entity type: node (or your article type)
  7. Incident entity type: node (or your ticket type)
  8. Click "Save"

Step 3: Add a Knowledge Field

  1. Navigate to Structure > Content types (/admin/structure/types)
  2. Select your target content type (e.g., "Article")
  3. Click "Manage fields"
  4. Click "Add field"
  5. Select "Knowledges" from the dropdown
  6. Enter label: "Knowledge Links"
  7. Click "Save and continue"
  8. Configure storage settings:
  9. Knowledge type: Select the type you created
  10. Short frequency: 15 days (default)
  11. Medium frequency: 90 days (default)
  12. Long frequency: 365 days (default)
  13. Click "Save field settings"
  14. Configure field settings:
    • Links per page: 50 (default)
    • Anonymous linking: Choose appropriate option
  15. Click "Save settings"

Step 4: Configure Display

  1. Click "Manage display" tab
  2. Ensure the Knowledge Links field is visible
  3. Select display formatter (usually "Knowledge default")
  4. Configure formatter settings if needed
  5. Click "Save"

Step 5: Run Database Updates (if updating from older version)

If you're upgrading from a previous version:

drush updb -y
drush cr

Or use the admin UI:

  1. Navigate to Reports > Available updates (/admin/reports/updates)
  2. Click "Run database updates"
  3. Review and apply pending updates

Enabling Optional Features

Knowledge LDAP Submodule

If you need LDAP integration for automatic leader assignment:

Prerequisites

Install the LDAP module first:

composer require drupal/ldap:~4
drush en ldap_servers ldap_user -y

Enable Knowledge LDAP

drush en knowledge_ldap -y

Configure LDAP Integration

  1. Navigate to Configuration > Knowledge > LDAP Settings
  2. Configure LDAP server connection
  3. Map LDAP attributes to leader fields
  4. Test the connection
  5. Save settings

Troubleshooting Installation

Common Issues

Issue: "Module Knowledge requires module X which is missing"

Solution: Install missing dependencies first:

composer require drupal/[missing-module]
drush en [missing-module] -y

Issue: "Database schema update required"

Solution: Run database updates:

drush updb -y

Or via UI at /admin/reports/status (click "Run updates")

Issue: "Composer require fails with version conflicts"

Solution: Try adding --with-all-dependencies:

composer require drupal/knowledge --with-all-dependencies

If still failing, update Drupal core first:

composer update drupal/core "drupal/core-*" --with-all-dependencies

Issue: "Access denied to knowledge administration pages"

Solution: 1. Clear cache: drush cr 2. Rebuild permissions: drush php:eval "node_access_rebuild();" 3. Check user permissions at /admin/people/permissions

Issue: "Field storage settings cannot be changed"

Solution: This is expected behavior after data exists. To change: 1. Export existing knowledge data 2. Delete all knowledge entities 3. Delete the field 4. Re-create field with new settings 5. Re-import data

Verifying Installation

Run these commands to verify everything is working:

# Check module status
drush pm:list --type=module --status=enabled | grep knowledge

# Verify database tables exist
drush sqlq "SHOW TABLES LIKE 'knowledge%';"

# Check for configuration
drush config:status | grep knowledge

# Clear cache
drush cr

Expected output: - Module shows as "Enabled" - Multiple knowledge* database tables exist - Configuration shows no warnings - Cache clears successfully

Getting Additional Help

If installation issues persist:

  1. Check Drupal logs: Navigate to Reports > Recent log messages (/admin/reports/dblog)
  2. Enable debugging: In settings.php, temporarily enable:
    $config['system.logging']['error_level'] = 'verbose';
    
  3. Check PHP error logs: Location varies by server setup
  4. Review requirements: Visit Reports > Status report (/admin/reports/status)
  5. Search issue queue: https://www.drupal.org/project/issues/knowledge
  6. Ask for help: Create a new issue with your installation details

Next Steps

After successful installation:

  1. Review the Configuration Guide for detailed setup instructions
  2. Read the User Guide to understand how to use the module
  3. Configure permissions appropriate for your organization
  4. Create test knowledge links to verify functionality
  5. Set up reporting to track knowledge management metrics

Uninstallation

If you need to remove the Knowledge module:

Warning

Uninstalling will permanently delete: - All knowledge entities - All competency records - All adherence records - All quality reviews - All knowledge fields and their data

Original content (articles, incidents) will be preserved, but the connections between them will be lost.

Backup First

Before uninstalling:

# Backup database
drush sql:dump > backup.sql

# Export configuration
drush config:export

# Export knowledge data if you might need it later
drush views:data:export knowledge --destination=/path/to/export

Uninstall Steps

  1. Remove knowledge fields from all content types:
  2. Go to each content type's "Manage fields" page
  3. Delete knowledge fields

  4. Disable the module:

    drush pm:uninstall knowledge -y
    

  5. Remove via Composer (if installed that way):

    composer remove drupal/knowledge
    

  6. Clean up:

    drush cr
    drush sql:sanitize
    

Upgrading

Between Minor Versions (e.g., 1.0 to 1.1)

# Update via Composer
composer update drupal/knowledge

# Run database updates
drush updb -y

# Clear cache
drush cr

# Verify
drush pm:list --type=module | grep knowledge

From Drupal 10 to Drupal 11

The Knowledge module is compatible with both Drupal 10.3+ and Drupal 11+. Follow standard Drupal core upgrade procedures:

  1. Update Drupal core first
  2. Test on a staging environment
  3. Update the Knowledge module
  4. Run database updates
  5. Test thoroughly before deploying to production

Migration from Other Knowledge Management Systems

If migrating from another system, create custom migrations:

  1. Create migration configuration files
  2. Use EntityKnowledge and EntityKnowledgeType destination plugins
  3. Map source data to knowledge entity fields
  4. Test on a copy of production
  5. Run migrations with drush migrate:import

See the API Documentation for details on migration plugins.