Introduction to Drupal 7 - Updating core, themes and modules. applying patches
-
Upload
kalin-chernev -
Category
Technology
-
view
2.332 -
download
1
description
Transcript of Introduction to Drupal 7 - Updating core, themes and modules. applying patches
Introduction to Drupal 7
Session 8.1
Updating core, themes and modules
1 Course by Init Lab (http://initlab.org) Drupalist: Kalin Chernev
Agenda
• Backing up your system
• Why and when to make updates
• Updating Drupal core
• Updating modules and themes
• Patching
2 Course by Init Lab (http://initlab.org) Drupalist: Kalin Chernev
Backup
• Absolutely important: never do anything on your system before backing it up!
• How to backup – 2 parts:
– Make a copy of your system files
– Export a dump of your database
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 3
Why and when
• Why: keeping your system secure and up-to-date
• When:
– On new versions of modules
– On security updates
– New features is introduced in the community
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 4
Exporting a dump from phpmyadmin
• The most conventional way to export a database backup is access the phpmyadmin
• Use the export functionalities
– Tar.gz is the best compression
– You may want to exclude cache tables
– Better than cpanel way of exporting data
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 5
Exporting from phpmyadmin
• Enter the phpmyadmin control panel
• Select the database you’d like to export
• Use the Export tab on top
• Keep the SQL type of export
• Select gzipped compression level
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 6
Exporting from phpmyadmin
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 7
Backup and migrate module
• Backup and migrate is a useful Drupal module
• Advantages – Easy to use with configurations
– No need to have access to phpmyadmin
– Cache tables are not dumped by default
– Choice of way to export the data
– Automatic regular backups are possible
• Be careful: – System performance may suffer from the automatic
regular backups
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 8
Using Backup and migrate module
• Administration > Configuration > System > Backup and Migrate
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 9
Updating Drupal core
• All files except the “sites” folder
• Sometimes the .htaccess is changed
• Sometimes the robots.txt file is changed
• Also additional PHP files are added
• You have to keep backup of your custom files and restore them after the update
• Run update.php script
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 10
Updating Drupal core
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 11
Run update.php
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 12
Apply pending changes
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 13
Updating modules and themes
• Backup initial files version locally
• Remove old files
• Add new files
• Run update.php script
• Check for errors – Dynamic sections using the module functionality
– General browsing the website
• If there are errors: try cleaning the cache
• If the errors do not go away: read the forums
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 14
Patching
• Anatomy of a patch
• When to patch: new features are added by community, but the module maintainer hasn’t introduced them in the module yet
• git or not git
• The NetBeans way for Windows
• The Linux way
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 15
Anatomy of a patch
• A patch is a document that shows the differences between 2 versions of one or more files.
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 16
Applying a patch in Windows
• To apply patches using NetBeans:
• Open the project and right-click on the file or folder you want to patch.
• Tools > Apply Diff Patch...
• Browse to and select the patch file you want to apply. > Click "Patch".
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 17
Applying a patch in Linux
• patch -pnum <patchfile
• or
• patch < /path/to/file
• patch [options] [originalfile [patchfile]]
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 18
git
• Git is the drupal.org versioning system
• Many functionalities to facilitate the creation and applying of patches
• Requires more technical knowledge to use
• The best versioning system you can choose to use if you’re going to use a versioning system anyway
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 19
Time for questions
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 20
Contacts
Kalin Chernev
– E: [email protected]
– T: twitter.com/kalinchernev
– U: http://shtrak.eu/kalata
Drupalist: Kalin Chernev Course by Init Lab (http://initlab.org) 21