DSLM - Drush Symlink Manager

DSLM is a set of Drush commands for managing symlinking Drupal 7 (and in the future D8, Wordpress, and Backdrop) sites back to central cores, installation profiles, plugins, and packages. It's a better way to handle the concept of multisite Drupal installs. With DSLM, users can manage many sites under one shared codebase achieving the same APC level caching benefits of multisite, but with better security and features like rolling updates.

Dependencies

Configuration and Installation

Screencast - How Penn State ELMS Learning Networking Migrated to DSLM

The first thing you'll want to do is download the dslm commands via drush: "drush dl dslm". You should then be able to see the dslm commands.

After you have the drush commands downloaded, you need to set up your DSLM Base directory. The DSLM Base directory must contain, at the very least, a "cores" directory which contains direct checkouts of drupal core. You may also add a "profiles" directory to hold any shared installation profiles you might want to use. Profiles and Cores must be suffixed with a version number, like this:

-- dslm_base
    -- cores
        -- drupal-6.18
        -- drupal-6.20
        -- drupal-7.12
    -- profiles
        -- myInstallProfile-6.x-1.0
        -- myInstallProfile-6.x-1.1
        -- myInstallProfile-7.x-1.0
        -- myInstallProfile-7.x-1.1
            -- modules
            -- themes
            -- libraries
    -- packages

-- packages_base (optional)
    -- contrib
        -- backup_migrate
            -- backup_migrate-7.x-3.1
    -- custom
        -- crowdfunding

Once your base is set up as described above, you'll need to pass it to drush dslm in order to run commands. There are three ways to set the location of your base: It will first look for the cli switch, then in your drushrc.php and finally for an environment variable.

  • The cli switch --dslm-base=/path/to/dslm_base
  • The drushrc.php file $options['dslm_base'] = /path/to/dslm_base;
  • The DSLM_BASE system environment variable

DSLM Commands

drush dslm-new [site-directory] [core]
Creates a new site within the directory of your choice using the Drupal core-version of your choice. If you pass the --latest flag, the latest core will automatically be chosen. If you do not specify a Drupal core-version, you will be prompted for a choice. (example usage: drush dslm-new newSite drupal-7.12)

drush dslm
Returns DSLM BASE, PACKAGES BASE, SITE DIRECTORY, and DSLM DIRECTORY

DSLM BASE: /data/code/dslm_base
PACKAGES BASE: /data/code/packages_base
SITE DIRECTORY: /data/web/express/webcentral/sites/all/modules/custom
DSLM DIRECTORY: /data/drush/dslm/dslm.drush.inc

drush dslm-cores
Returns a listing of available DSLM cores. --format compatible

drush dslm-profiles
Returns a listing of available DSLM profiles. --format compatible

<<< Execute the following commands within a site set up with DSLM >>>

drush dslm-info
Returns the current core and any managed profiles symlinked to the site of your cwd. --format compatible

drush dslm-switch-core [name]-[version]
Switches the core symlinks within your cwd's site, to a different version of Drupal core. If you do not specify a core, an interactive prompt will ask. (example usage: drush dslm-switch-core drupal-7.15)

drush dslm-add-profile [profile-name]-[profile-version]
Creates a symlink within the 'profiles' directory to a DSLM managed installation profile. If you do not specify a profile name and/or version, you will be prompted for a choice. If the option --upgrade is passed, DSLM will remove the already symlinked profile and add your new specified (or prompted) version. (example usage: drush dslm-add-profile myInstallProfile-2.0 --upgrade)

drush dslm-remove-profile [profile-name]
If you specify a valid profile name to be removed, the symlink will be removed, otherwise you will be prompted with a list of DSLM-managed installation profiles this site has available to be removed.

drush dslm-add-contrib [project-name] [project-name]
Creates a symlink within the 'sites/all/[type]/contrib' directory to each DSLM managed project listed. If you do not specify a profile name and/or version, you will be prompted for a choice.

drush dslm-add-custom [project-name] [project-name]
Creates symlinks within the 'sites/all/[type]/custom' directory for all modules, themes, and libraries in a DSLM managed custom project. Custom projects do not support versions.

drush dslm-remove-all-custom
All symlinks in 'sites/all/modules/custom', 'sites/all/themes/custom', and 'sites/all/libraries/custom' will be removed. This should be done before dslm-add-custom to remove any projects that no longer exist in the custom project.

Supporting organizations: 
Initial development, ongoing feature additions, and maintenance

Project information

Releases