Drush and drupal. администрирование волчек михаил
-
Upload
drupalconf -
Category
Technology
-
view
426 -
download
0
Transcript of Drush and drupal. администрирование волчек михаил
![Page 1: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/1.jpg)
Drush and Drupal. Administration
Web-developerDrupal-club (Belarus)
twitter: mikhail_volchek
drupal-sliot.by
Michael Volchek
![Page 2: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/2.jpg)
Спонсоры
Генеральный спонсор
Серебряный спонсор Серебряный спонсор
Бронзовый спонсор Бронзовый спонсор
Организатор
![Page 3: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/3.jpg)
For whom?
• Who wants to implement current updates rapidly
• Who doesn’t like to do the same actions again and again
• Who chooses Linux hosting
• Who likes shell (drupal+shell=drush)
• And it is comfortable for local developing (deployment, supporting, migration, backup)
![Page 4: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/4.jpg)
Basic Commands
• Drush <host> status
• Drush dl <project_1> < project_2> < project_3>
• the same with drush en/dis/pm-uninstall
• Drush cc [all|menu|css-js…]
• Drush help <some_command>
• etc
![Page 5: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/5.jpg)
Coworking Drush and Linux
• For example:
• drush dis pathauto && drush pm-uninstall pathauto && rm –rf pathauto
• drush dl omega_tools && drush en omega_tools –y
• drush pm-list | grep omega
![Page 6: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/6.jpg)
New Modules - New Commands
• For example:
• drush omega-subtheme "Test theme" html5 --machine_name=test_theme && drush en test_theme -y && drush pm-list | grep test_theme
![Page 7: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/7.jpg)
Install Drupal
1. Prepare database (mysql>create database <DB_name>;)
2. Use one drush command site-install (or alias si)
• drush si standard --db-url=mysql://<DB_user>:<passwd>@<DB_host>/<DB_name> --db-su=<admin> -db-su-pw=<some_password> --site-name=‘Dev Site!’
![Page 8: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/8.jpg)
Recover user’s password
or how to crack Drupal users
Use
•drush uli -l http://<somehost>
or
•drush upwd <user> --password=<password>
![Page 9: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/9.jpg)
Minor Drupal Updating
7.10 to 7.14
1.!Backup! Project DataBase and Files /.htaccess and robots.txt
2.Move from project all custom files/folders
3.Switch on update module
4.drush upc / up -y
•Wait for a moment
•That’s all
•It takes you about 5 minutes
•Use the same command for contrib modules UPD
![Page 10: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/10.jpg)
Major updating… faced with
• Contributed module developing (for example: /project/photos – last update - 2009-Dec-30)
• But it needs to migrate about 150 albums and 6000 photos
• If you still hardcode (or hook) contributed modules
• Need to rewrite custom themes
![Page 11: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/11.jpg)
Drush Updating
• /usr/local/share/drush
• cd /usr/local/share/
• drush dl drush --destination=.
• and use drush cc drush (clear drush cache)
![Page 12: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/12.jpg)
qd command
• Without VH, DB… ready Drupal profile
• Sqlite issue
• Server settings
• Why to do it?
![Page 13: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/13.jpg)
Alias
• $aliases['dev'] = array('root' => '/path/to/drupal', 'uri' => 'dev.mydrupalsite.com', );
• drush @dev status
• $ drush --root=/path/to/drupal --uri=dev.mydrupalsite.com status
![Page 14: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/14.jpg)
Git + cron + drush
• GitHub.com is our basic repo
• Use script files (*.sh)
• Use git command (for example: git pull) there
• Use drush command there (sql-dump or cc all)
• And cron schedule (crontab -e)
![Page 15: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/15.jpg)
Git + cron + drush
![Page 16: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/16.jpg)
Drush in windows
• Windows installer from 5.x version
• To install with online connection (required pecl library)
• Additional mysql software tuning (for example drush sql-dump)
![Page 17: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/17.jpg)
Drush Hardships
• To start using it. For window’s and click-mouse funs it may be a psychological issue
• That's not the game for share hosting
• More flexible and usable in Linux platform.
• At the beginning you need to learn a list of popular commands. U can print it and stick to wall.
• Update modules issue in distributives (for example, OpenAtrium)
![Page 18: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/18.jpg)
Conclusion
• Use open source software
• Commands shell – more health-given for your fingers =)
• It saves your time!
![Page 19: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/19.jpg)
Useful links
• drush.ws - documentation
• http://igusev.ru/drupal/omega/omega-drush-subtheme-creation - use with omega
• http://www.summasolutions.net/blogposts/implementing-drush-commands - write your own commands
• http://civicactions.com/team/owen_barton - interesting screencasts
![Page 20: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/20.jpg)
Thanks
Drupal Club (Belarus)
skype: fannrmus
twitter: mikhail_volchek
Michael Volchek
![Page 21: Drush and drupal. администрирование волчек михаил](https://reader036.fdocuments.in/reader036/viewer/2022062313/557ec7a7d8b42ae27f8b4787/html5/thumbnails/21.jpg)
Спонсоры
Генеральный спонсор
Серебряный спонсор Серебряный спонсор
Бронзовый спонсор Бронзовый спонсор
Организатор