SlideShare a Scribd company logo
1 of 22
Download to read offline
Drush + Multisite:
                                  drush_multi

                                       Florian Latzel




drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   1
whoami


    Florian „@fl3a“ Latzel
     ●   Staatl. gepr. Informatiker
     ●   LPIC Level 2, Novell CLA
     ●   Since '06 Freelance IT Consultant
           at „ISL Individuelle System Lösungen“
               –   Open Source Software
               –   Content Management Systeme
               –   Web-Entwicklung
               –   Analysis, Conception, Training
     ●   Blog: http://netzaffe.de
drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   2
cat ~/ddd/slides/drush_multi/toc

   ●   Drush
   ●   Multisite
   ●   drush_multi
   ●   Motivation
   ●   Commands
   ●   Pitfalls
   ●   Appendix
   ●   Credits
   ●   Q&A
drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   3
whatis drush




drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   4
whatis drush


    DRUpal SHell
    ●   Projectpage:
        http://drupal.org/project/drush
    ●   Mostly on unixoid systems
    ●   PHP-CLI Script
    ●   No Drupal module
                   → Needs no Drupal installation
                   → Independent from Drupal version(5.x, 6.x, 7.x)



drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   5
ls ­l /home/florian/public_html/drupal


   Multisite
    drupal/
    |­­ 6.x ­> drupal­6.14
    |­­ 6.x_backup
    |­­ 6.x_profiles
    |­­ 6.x_sites
    |   |­­ all   
    |   |­­ default
    |   |­­ example.com
    |   |   |­­ files
    |   |   |­­ modules
    |   |   `­­ themes
    |   `­­ sub.example.com 
    |       |­­ files
    |       |­­ modules
    |       `­­ themes 
    `­­ drupal­6.14
       |­­ backup ­> ../6.x_backup
       |­­ includes
       |­­ misc
       |­­ modules
       |­­ profiles ­> ../6.x_profiles
       |­­ scripts
       `­­ sites  ­> ../6.x_sites 

drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   6
firefox http://drupal.org/project/drush_multi


   drush_multi
    ●   Project-page
        http://drupal.org/project/drush_multi
    ●   Doxygen Documentation
        http://is-loesungen.de/docu/drush_multi
    ●   Requires drush >= v.3.0-beta1
    ●   State: „Experimental“
    ●   Installation over CVS
    ●   @todo's
        http://is-loesungen.de/docu/drush_multi/todo.html

drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   7
why?


   Motivations
    ●   Shellscript VS drush command
    ●   Got sparetime
    ●   Admins are lazy
    ●   i <3 drush




drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   8
multi­create (mcr, create)


   Creates a multisite installation                                      [1].
   Examples:
    drush multi­create /var/www 6                    Create a drupal 6 installation in 
                                                     /var/www with creating the directories
                                                     6.x_backup, 6.x_profiles and 6.x_sites 
                                                     in /var/www linked as backup, profiles 
                                                     and sites and backup withing the
                                                     drupal installation folder.

   Arguments:
    /path/to/installation                            Directoy where drupal should be
                                                     installed. Mandatory.
   Options:
     ­­makefile                                      Path to drush_make makefile.           
                                                     The makefile must contain the core 
                                                     specification (eg. "core = 6.x" for 
                                                     Drupal 6) and Drupal as Project 
                                                     projects[] =  drupal). 
                                                     (projects[] =  drupal).
    ­­core                                           Drupal core version (5.x, 6.x).

drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   9
multi­site (msi, site)


   Creates a site within the installation.
   Examples:
    drush ­r /path/to/drupal multi­site                        Create the site 'example.com'  
    example.com                                                within a 'files', a 'themes',  
    ­­create­directories=dir1,dir2,dir3                        a 'modules' directory  and the 
                                                               additional directories 'dir1', 
                                                               'dir2' and 'dir3' in 
                                                               /path/to/drupal/sites.
   Arguments:
    Site­name                                                  Name of the site. Mandatory.
   Options:
    ­­create­directories                   Comma seperated list of 
                                           aditional directories.




drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   10
multi­status (mst)


   State of a multisite installation.


   drush ­r /path/to/drupal multi­status


   Extends the drush status with
    ●   Sites
    ●   Sitecounter
    ●   Previous Drupal versionen
    ●   Core status


drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   11
multi­exec (mex)


   Batch operations over all sites [2].
   Examples:
   drush ­r /path/to/drupal multi­exec       
   Arguments: 
    command                  The drush command to execute. For drush 
                             commands with blanks like 'watchdog show'
                             make sure to use single or double quotes. 
                             Mandatory.
   Options:
     ­­argument              Argument to pass to drush command e.g. 
                             'php' as type for 'watchdog delete' and
                             'watchdog show'. Optional.

    ­­option                               Option to pass to drush command. e.g. 
                                           '­­limit=20' for 'watchdog show'. 
                                           The number of messages to show. 
                                           Optional.

drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   12
multi­sql­dump (msq)


   SQL dumps over all sites. (Batch-Mode)
   Examples:
   drush ­r /path/to/drupal multi sql dump ­­bzip2 ­­comment=before­
   update­to­6.15  ­­destination=$HOME/db_backups
   Options:
     ­­target                    Absolute Path to the directory where to
                                 store the sql dumps. Default /tmp.
     ­­dump­type                 Arguments: 
                                 "full" Creates one file for all tables 
                                 (default).
                                 "tables" Creates for each table within 
                                 each database a seperate file.
     ­­comment                   Comment for filename. May contain
                                 alphanumics, '­' and '_'. Optional.
     ­­datetime                  Adds an optional datetime string to each 
                                 result file. Format YYYY­MM­DDThh:mm
     ­­bzip2                     Use bzip2 for compression of each sql 
                                 dump. Optional

drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   13
multi­nagios (mna, nagios)


  For the usage as Nagios plugin.

  drush ­r /path/to/drupal multi­nagios


  Options:
   ­­file             Path to release information file, this could
                      be a (temp) file to avoid nrpe­socket­timeouts.
                      It is also possible to supply path via URI,
                      like http://updates.drupal.org/release­
                      history/drupal/6.x.



  Monitors the Drupal-Installation on core updates.
  Message output and exit status. (0 = OK, 2 = Critical)

drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   14
return MULTI_NAGIOS_OK;




drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   15
return MULTI_NAGIOS_CRITICAL;




drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   16
multi­drupalupdate (mdr, drupalupdate)


   Update of the Drupal core...
   Examples:
    drush ­r /path/to/drupal                         Update your drupal installation
     multi­drupalupdate                              to the recommended release.

    drush ­r /path/to/drupal                         Runs a "multi­drupalupdate" 
     multi­drupalupdate                              on /path/to/drupal with making sql
     ­­sql­dump                                      dumps of all  sites with optional      
     ­­comment="before drupaldate"                   comment "before drupalupdate" for
     ­­updatedb                                      sql dump filenames and execution of
                                                     "updatedb" afterwards.
   Options:
    ­­sql­dump                                 Calls multi_sql_dump for all sites 
                                               before starting the drupalupdate.
                                               See "drush help multi­sql­dump" for
                                               options and details.
    ­­updatedb                                 Put sites in maintenance mode 
                                               before drupalupdate, execute 
                                               updatedb and put sites back from 
                                               maintenance mode after drupalupdate.

drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   17
preg_match(): No ending delimiter '^' found


   Pitfalls
    ●   Found Drush hooks by random[3]
    ●   Removement of the Shebang in drush.php[4][5]
    ●   Renaming from dl to download
        → Introduction of aliases in drush 2.1[6][7]
    ●   Change in drush_scan_directory() in drush 2.1:
        → Replaced ereg() through preg_match()
    ●   Returnvalue of _pm_get_update_info() differs
        from Drupal 5.x to 6.x
    ●   PHP 5.3 :D

drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   18
Appendix


    [1] #652778 Similar functionality coming to drush
      core.
      http://drupal.org/node/652778
      @see also #628996: Concurrently execute a
      single drush command on multiple sites.
      http://drupal.org/node/628996
    [2] Drush Make Projectpage
      http://drupal.org/project/drush_make
    [3] #349923 drush_invoke : a flexible API for
      hooking into any and all drush calls.
      http://drupal.org/node/349923
      → drush >= 2.1 in drush.api.php
drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   19
Appendix


    [4] #586466 Drush.php is no longer directly
      executable (can interfere with backend invoke)
      http://drupal.org/node/586466
    [5] #549494 Support for command aliases
       http://drupal.org/node/549494
    [6]Blogpost about the 2.1 release of drush
      http://netzaffe.de/blog/2009/10/27/drush-6-x-2-1-
      release.html




drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   20
cat ~/workspace/drush_multi/CREDITS.txt

    ●   hundfred
    ●   robertDouglass
    ●   JAM
    ●   Cyberschorsch
    ●   @andkoe
    ●   torstenzenk
    ●   hansfn
   Last but not least
    ●   moshe weitzman
    ●   greg.1.anderson
drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   21
which; whatis; who >/dev/null


    Questions?


    florian.latzel@is-loesungen.de




drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen   22

More Related Content

What's hot

Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...Phase2
 
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016Paul McKibben
 
Ts drupal6 module development v0.2
Ts   drupal6 module development v0.2Ts   drupal6 module development v0.2
Ts drupal6 module development v0.2Confiz
 
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011camp_drupal_ua
 
Plain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticalsPlain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticalsAngela Byron
 
Ansible Project Deploy (phpbenelux 2015)
Ansible Project Deploy (phpbenelux 2015)Ansible Project Deploy (phpbenelux 2015)
Ansible Project Deploy (phpbenelux 2015)Ramon de la Fuente
 
Drupal 6 - podstawy - www.openbit.pl
Drupal 6 - podstawy - www.openbit.plDrupal 6 - podstawy - www.openbit.pl
Drupal 6 - podstawy - www.openbit.plGrzegorz Bartman
 
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
Leonid Vasilyev  "Building, deploying and running production code at Dropbox"Leonid Vasilyev  "Building, deploying and running production code at Dropbox"
Leonid Vasilyev "Building, deploying and running production code at Dropbox"IT Event
 
Drush Aegir & Drush, Drupal Roadshow Austria
Drush Aegir & Drush, Drupal Roadshow AustriaDrush Aegir & Drush, Drupal Roadshow Austria
Drush Aegir & Drush, Drupal Roadshow AustriaIztok Smolic
 
Balisage - EXPath - A practical introduction
Balisage - EXPath - A practical introductionBalisage - EXPath - A practical introduction
Balisage - EXPath - A practical introductionFlorent Georges
 
2 Linux Container and Docker
2 Linux Container and Docker2 Linux Container and Docker
2 Linux Container and DockerFabio Fumarola
 
8b. Column Oriented Databases Lab
8b. Column Oriented Databases Lab8b. Column Oriented Databases Lab
8b. Column Oriented Databases LabFabio Fumarola
 
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011camp_drupal_ua
 
Bring drupal 8 to all in their native languages
Bring drupal 8 to all in their native languagesBring drupal 8 to all in their native languages
Bring drupal 8 to all in their native languagesSébastien Corbin
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Drupalcon Paris
 

What's hot (18)

Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
 
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
 
Migrating data to drupal 8
Migrating data to drupal 8Migrating data to drupal 8
Migrating data to drupal 8
 
Ts drupal6 module development v0.2
Ts   drupal6 module development v0.2Ts   drupal6 module development v0.2
Ts drupal6 module development v0.2
 
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
 
Plain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticalsPlain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticals
 
Ansible Project Deploy (phpbenelux 2015)
Ansible Project Deploy (phpbenelux 2015)Ansible Project Deploy (phpbenelux 2015)
Ansible Project Deploy (phpbenelux 2015)
 
Drupal 6 - podstawy - www.openbit.pl
Drupal 6 - podstawy - www.openbit.plDrupal 6 - podstawy - www.openbit.pl
Drupal 6 - podstawy - www.openbit.pl
 
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
Leonid Vasilyev  "Building, deploying and running production code at Dropbox"Leonid Vasilyev  "Building, deploying and running production code at Dropbox"
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
 
3 Git
3 Git3 Git
3 Git
 
Drush Aegir & Drush, Drupal Roadshow Austria
Drush Aegir & Drush, Drupal Roadshow AustriaDrush Aegir & Drush, Drupal Roadshow Austria
Drush Aegir & Drush, Drupal Roadshow Austria
 
Ansible project-deploy
Ansible project-deployAnsible project-deploy
Ansible project-deploy
 
Balisage - EXPath - A practical introduction
Balisage - EXPath - A practical introductionBalisage - EXPath - A practical introduction
Balisage - EXPath - A practical introduction
 
2 Linux Container and Docker
2 Linux Container and Docker2 Linux Container and Docker
2 Linux Container and Docker
 
8b. Column Oriented Databases Lab
8b. Column Oriented Databases Lab8b. Column Oriented Databases Lab
8b. Column Oriented Databases Lab
 
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
 
Bring drupal 8 to all in their native languages
Bring drupal 8 to all in their native languagesBring drupal 8 to all in their native languages
Bring drupal 8 to all in their native languages
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 

Similar to drush_multi @ DrupalDevDays 2010

A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013Chris Hales
 
Exploring composer in drupal 8 with drupal project - salva molina
Exploring composer in drupal 8 with drupal project - salva molinaExploring composer in drupal 8 with drupal project - salva molina
Exploring composer in drupal 8 with drupal project - salva molinaSalvador Molina (Slv_)
 
Improving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAImproving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAJesus Manuel Olivas
 
Drush A beginners guide to a advanced tool.
Drush A beginners guide to a advanced tool.Drush A beginners guide to a advanced tool.
Drush A beginners guide to a advanced tool.Mediacurrent
 
Drush workshop
Drush workshopDrush workshop
Drush workshopJuampy NR
 
Face your fears: Drush and Aegir
Face your fears: Drush and AegirFace your fears: Drush and Aegir
Face your fears: Drush and AegirIztok Smolic
 
Pavlenko Sergey. Drush: using and creating custom commands. DrupalCamp Kyiv 2011
Pavlenko Sergey. Drush: using and creating custom commands. DrupalCamp Kyiv 2011Pavlenko Sergey. Drush: using and creating custom commands. DrupalCamp Kyiv 2011
Pavlenko Sergey. Drush: using and creating custom commands. DrupalCamp Kyiv 2011Vlad Savitsky
 
Drush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - SivajiDrush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - SivajiDrupal Camp Delhi
 
Drush&drupal. administration
Drush&drupal. administrationDrush&drupal. administration
Drush&drupal. administrationzabej
 
drush - the commandline is your friend
drush - the commandline is your frienddrush - the commandline is your friend
drush - the commandline is your friendNathan Lisgo
 
Speed up Drupal development with Drush
Speed up Drupal development with DrushSpeed up Drupal development with Drush
Speed up Drupal development with Drushkbasarab
 
Drush in the Composer Era
Drush in the Composer EraDrush in the Composer Era
Drush in the Composer EraPantheon
 
Using Composer with Drupal and Drush
Using Composer with Drupal and DrushUsing Composer with Drupal and Drush
Using Composer with Drupal and DrushPantheon
 
Drupal Overview For Techies
Drupal Overview For TechiesDrupal Overview For Techies
Drupal Overview For TechiesRobert Carr
 
Drupal 8 update & drush: October 2014
Drupal 8 update & drush: October 2014Drupal 8 update & drush: October 2014
Drupal 8 update & drush: October 2014Vladimir Roudakov
 
Depolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and CapistranoDepolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and Capistranolibsys
 
Drush. Why should it be used?
Drush. Why should it be used?Drush. Why should it be used?
Drush. Why should it be used?Sergei Stryukov
 

Similar to drush_multi @ DrupalDevDays 2010 (20)

A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013
 
Exploring composer in drupal 8 with drupal project - salva molina
Exploring composer in drupal 8 with drupal project - salva molinaExploring composer in drupal 8 with drupal project - salva molina
Exploring composer in drupal 8 with drupal project - salva molina
 
Improving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAImproving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLA
 
Drush A beginners guide to a advanced tool.
Drush A beginners guide to a advanced tool.Drush A beginners guide to a advanced tool.
Drush A beginners guide to a advanced tool.
 
Drush workshop
Drush workshopDrush workshop
Drush workshop
 
Face your fears: Drush and Aegir
Face your fears: Drush and AegirFace your fears: Drush and Aegir
Face your fears: Drush and Aegir
 
Pavlenko Sergey. Drush: using and creating custom commands. DrupalCamp Kyiv 2011
Pavlenko Sergey. Drush: using and creating custom commands. DrupalCamp Kyiv 2011Pavlenko Sergey. Drush: using and creating custom commands. DrupalCamp Kyiv 2011
Pavlenko Sergey. Drush: using and creating custom commands. DrupalCamp Kyiv 2011
 
Drush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - SivajiDrush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - Sivaji
 
Intro to Drush
Intro to DrushIntro to Drush
Intro to Drush
 
Drush&drupal. administration
Drush&drupal. administrationDrush&drupal. administration
Drush&drupal. administration
 
drush - the commandline is your friend
drush - the commandline is your frienddrush - the commandline is your friend
drush - the commandline is your friend
 
Speed up Drupal development with Drush
Speed up Drupal development with DrushSpeed up Drupal development with Drush
Speed up Drupal development with Drush
 
Beginning Drush
Beginning DrushBeginning Drush
Beginning Drush
 
Drush in the Composer Era
Drush in the Composer EraDrush in the Composer Era
Drush in the Composer Era
 
Using Composer with Drupal and Drush
Using Composer with Drupal and DrushUsing Composer with Drupal and Drush
Using Composer with Drupal and Drush
 
Drupal Overview For Techies
Drupal Overview For TechiesDrupal Overview For Techies
Drupal Overview For Techies
 
Intro to Drush
Intro to DrushIntro to Drush
Intro to Drush
 
Drupal 8 update & drush: October 2014
Drupal 8 update & drush: October 2014Drupal 8 update & drush: October 2014
Drupal 8 update & drush: October 2014
 
Depolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and CapistranoDepolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and Capistrano
 
Drush. Why should it be used?
Drush. Why should it be used?Drush. Why should it be used?
Drush. Why should it be used?
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

drush_multi @ DrupalDevDays 2010

  • 1. Drush + Multisite: drush_multi Florian Latzel drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 1
  • 2. whoami Florian „@fl3a“ Latzel ● Staatl. gepr. Informatiker ● LPIC Level 2, Novell CLA ● Since '06 Freelance IT Consultant at „ISL Individuelle System Lösungen“ – Open Source Software – Content Management Systeme – Web-Entwicklung – Analysis, Conception, Training ● Blog: http://netzaffe.de drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 2
  • 3. cat ~/ddd/slides/drush_multi/toc ● Drush ● Multisite ● drush_multi ● Motivation ● Commands ● Pitfalls ● Appendix ● Credits ● Q&A drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 3
  • 4. whatis drush drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 4
  • 5. whatis drush DRUpal SHell ● Projectpage: http://drupal.org/project/drush ● Mostly on unixoid systems ● PHP-CLI Script ● No Drupal module → Needs no Drupal installation → Independent from Drupal version(5.x, 6.x, 7.x) drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 5
  • 6. ls ­l /home/florian/public_html/drupal Multisite  drupal/  |­­ 6.x ­> drupal­6.14  |­­ 6.x_backup  |­­ 6.x_profiles  |­­ 6.x_sites  |   |­­ all     |   |­­ default  |   |­­ example.com  |   |   |­­ files  |   |   |­­ modules  |   |   `­­ themes  |   `­­ sub.example.com   |       |­­ files  |       |­­ modules  |       `­­ themes   `­­ drupal­6.14     |­­ backup ­> ../6.x_backup     |­­ includes     |­­ misc     |­­ modules     |­­ profiles ­> ../6.x_profiles     |­­ scripts     `­­ sites  ­> ../6.x_sites  drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 6
  • 7. firefox http://drupal.org/project/drush_multi drush_multi ● Project-page http://drupal.org/project/drush_multi ● Doxygen Documentation http://is-loesungen.de/docu/drush_multi ● Requires drush >= v.3.0-beta1 ● State: „Experimental“ ● Installation over CVS ● @todo's http://is-loesungen.de/docu/drush_multi/todo.html drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 7
  • 8. why? Motivations ● Shellscript VS drush command ● Got sparetime ● Admins are lazy ● i <3 drush drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 8
  • 9. multi­create (mcr, create) Creates a multisite installation [1]. Examples:  drush multi­create /var/www 6 Create a drupal 6 installation in  /var/www with creating the directories 6.x_backup, 6.x_profiles and 6.x_sites  in /var/www linked as backup, profiles  and sites and backup withing the drupal installation folder. Arguments:  /path/to/installation Directoy where drupal should be installed. Mandatory. Options:   ­­makefile   Path to drush_make makefile.                                             The makefile must contain the core  specification (eg. "core = 6.x" for  Drupal 6) and Drupal as Project  projects[] =  drupal).  (projects[] =  drupal).  ­­core                           Drupal core version (5.x, 6.x). drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 9
  • 10. multi­site (msi, site) Creates a site within the installation. Examples:  drush ­r /path/to/drupal multi­site Create the site 'example.com'    example.com within a 'files', a 'themes',    ­­create­directories=dir1,dir2,dir3 a 'modules' directory  and the  additional directories 'dir1',  'dir2' and 'dir3' in  /path/to/drupal/sites. Arguments:  Site­name Name of the site. Mandatory. Options:  ­­create­directories                   Comma seperated list of  aditional directories. drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 10
  • 11. multi­status (mst) State of a multisite installation. drush ­r /path/to/drupal multi­status Extends the drush status with ● Sites ● Sitecounter ● Previous Drupal versionen ● Core status drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 11
  • 12. multi­exec (mex) Batch operations over all sites [2]. Examples: drush ­r /path/to/drupal multi­exec        Arguments:   command                  The drush command to execute. For drush  commands with blanks like 'watchdog show' make sure to use single or double quotes.  Mandatory. Options:   ­­argument   Argument to pass to drush command e.g.  'php' as type for 'watchdog delete' and                           'watchdog show'. Optional.  ­­option  Option to pass to drush command. e.g.  '­­limit=20' for 'watchdog show'.  The number of messages to show.  Optional. drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 12
  • 13. multi­sql­dump (msq) SQL dumps over all sites. (Batch-Mode) Examples: drush ­r /path/to/drupal multi sql dump ­­bzip2 ­­comment=before­ update­to­6.15  ­­destination=$HOME/db_backups Options:   ­­target                    Absolute Path to the directory where to store the sql dumps. Default /tmp.   ­­dump­type Arguments:  "full" Creates one file for all tables  (default). "tables" Creates for each table within  each database a seperate file.   ­­comment                   Comment for filename. May contain   alphanumics, '­' and '_'. Optional.   ­­datetime Adds an optional datetime string to each  result file. Format YYYY­MM­DDThh:mm   ­­bzip2 Use bzip2 for compression of each sql  dump. Optional drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 13
  • 14. multi­nagios (mna, nagios) For the usage as Nagios plugin. drush ­r /path/to/drupal multi­nagios Options:  ­­file Path to release information file, this could be a (temp) file to avoid nrpe­socket­timeouts. It is also possible to supply path via URI,   like http://updates.drupal.org/release­ history/drupal/6.x. Monitors the Drupal-Installation on core updates. Message output and exit status. (0 = OK, 2 = Critical) drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 14
  • 15. return MULTI_NAGIOS_OK; drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 15
  • 16. return MULTI_NAGIOS_CRITICAL; drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 16
  • 17. multi­drupalupdate (mdr, drupalupdate) Update of the Drupal core... Examples:  drush ­r /path/to/drupal Update your drupal installation   multi­drupalupdate to the recommended release.  drush ­r /path/to/drupal Runs a "multi­drupalupdate"    multi­drupalupdate on /path/to/drupal with making sql   ­­sql­dump dumps of all  sites with optional         ­­comment="before drupaldate" comment "before drupalupdate" for   ­­updatedb sql dump filenames and execution of   "updatedb" afterwards. Options:  ­­sql­dump Calls multi_sql_dump for all sites  before starting the drupalupdate. See "drush help multi­sql­dump" for options and details.  ­­updatedb               Put sites in maintenance mode  before drupalupdate, execute  updatedb and put sites back from  maintenance mode after drupalupdate. drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 17
  • 18. preg_match(): No ending delimiter '^' found Pitfalls ● Found Drush hooks by random[3] ● Removement of the Shebang in drush.php[4][5] ● Renaming from dl to download → Introduction of aliases in drush 2.1[6][7] ● Change in drush_scan_directory() in drush 2.1: → Replaced ereg() through preg_match() ● Returnvalue of _pm_get_update_info() differs from Drupal 5.x to 6.x ● PHP 5.3 :D drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 18
  • 19. Appendix [1] #652778 Similar functionality coming to drush core. http://drupal.org/node/652778 @see also #628996: Concurrently execute a single drush command on multiple sites. http://drupal.org/node/628996 [2] Drush Make Projectpage http://drupal.org/project/drush_make [3] #349923 drush_invoke : a flexible API for hooking into any and all drush calls. http://drupal.org/node/349923 → drush >= 2.1 in drush.api.php drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 19
  • 20. Appendix [4] #586466 Drush.php is no longer directly executable (can interfere with backend invoke) http://drupal.org/node/586466 [5] #549494 Support for command aliases http://drupal.org/node/549494 [6]Blogpost about the 2.1 release of drush http://netzaffe.de/blog/2009/10/27/drush-6-x-2-1- release.html drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 20
  • 21. cat ~/workspace/drush_multi/CREDITS.txt ● hundfred ● robertDouglass ● JAM ● Cyberschorsch ● @andkoe ● torstenzenk ● hansfn Last but not least ● moshe weitzman ● greg.1.anderson drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 21
  • 22. which; whatis; who >/dev/null Questions? florian.latzel@is-loesungen.de drush_multi | Florian Latzel | Drupal Dev Days, Munich 2010 | ISL Individuelle System Lösungen 22