Taking your site from Drupal 6 to Drupal 7
-
Upload
phase2 -
Category
Technology
-
view
4.194 -
download
0
description
Transcript of Taking your site from Drupal 6 to Drupal 7
![Page 1: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/1.jpg)
Taking your site from Drupal 6 to
Drupal 7Tobby Hagler, Phase2 Technology
![Page 2: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/2.jpg)
Overview• Modules incorporated into Drupal Core• How does this affect your work as a site maintainer• Why not just stay in Drupal 6?• How do I know when to upgrade• Migration vs. Upgrading• Tools to upgrade or migrate
![Page 3: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/3.jpg)
Biggest changes between D6 and
D7• Theme changes• New templates such as html.tpl.php• Render arrays• Module changes• Database changes – DBTNG
![Page 4: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/4.jpg)
Contrib modulesin Drupal Core
• CCK became Fields API• Imagecache became Image Styles• Tokens• Admin• jQuery UI• And many more – drupal.org/node/895314
![Page 5: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/5.jpg)
How does thisaffect site
maintainers• Can keep the site’s look and feel to the average user• May encounter drastic shifts in modules and site
administration• Will possibly require retraining (for site editors,
content producers, etc)
![Page 6: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/6.jpg)
Why not juststay in Drupal 6?
• New modules developed for Drupal 7 only• Focus shift to Drupal 8, support for Drupal 6
will dwindle to security updates.• Drupal 7 allows for bigger scale (database
replication, storage engines)
![Page 7: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/7.jpg)
Know when it's time
• Don’t get left behind – Module development shifts to D7, D6 support will dwindle
• Site cruft – As a site ages, cruft keeps a site from being maintainable in its current state
![Page 8: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/8.jpg)
Upgrading vs. Migration
• Determine how much of your site can easily be upgraded• Some modules have been deprecated, abandoned, or
replaced• Inventory your site• Know that some content must still be migrated (CCK, user
profiles, Image files)
![Page 9: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/9.jpg)
What about my theme?
• Most likely, you’ll need to rebuild it• Converting themes from Drupal 6 to Drupal 7 –
drupal.org/node/254940• Render Arrays in Drupal 7 – drupal.org/node/930760• jQuery UI is in core now
![Page 10: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/10.jpg)
What do I need?• Dev environment (vhosts or localhost)• SSH or FTP• MySQL access to create new databases• Drush – drupal.org/project/drush
![Page 11: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/11.jpg)
Site inventory• Show-stoppers – required functionality• Next round upgrades – What’s used but not required?• A better way? – Context and Features• Nice-to-have or not worth the effort?• Alternative replacements – 3rd party plugins• Cut list – Identify site cruft
![Page 12: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/12.jpg)
Site inventory:Show stoppers
• Check project page for 7.x version or core status• Consider dependency change• Look for upgrade paths or replacement modules• If missing, you’ll probably want to rebuild and migrate
![Page 13: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/13.jpg)
Determineupgrade paths
• Drupal core always has an upgrade path – See UPGRADE.txt
• Many popular modules have upgrade paths• Some modules include documentation to
migrate to other modules
![Page 14: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/14.jpg)
Replacedeprecated
modules• Nodewords is replaced with Metatags – no
backwards compatibility• Thickbox is replaced by Colorbox – a drop-
in replacement
![Page 15: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/15.jpg)
Upgrade process• Find a way to quickly instantiate a copy• Backup and work on a new instance• Disable all contrib modules …and test• Upgrade Drupal core …and test• Upgrade contrib modules in order of importance to the
site …and test
![Page 16: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/16.jpg)
Upgrade process:Core
• See drupal.org/node/570162• Set theme to a core theme• Disable all contrib modules• Remove settings.php• Copy 7.x over existing site• Run update.php• Upgrade CCK content
![Page 17: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/17.jpg)
Upgrade process:CCK to Fields API
• See drupal.org/node/1144136• Install CCK 7.x• Admin > Structure > Migrate Fields• May need additional CCK-related modules• Test content and content types
![Page 18: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/18.jpg)
Upgrade process:Contrib modules
• Download and install 7.x versions• Check project page for migration instructions• Drush is your friend• drush dl module• drush en module• drush updatedb
![Page 19: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/19.jpg)
Additional toolsto help upgrade
• Upgrade Status and Upgrade Assist – drupal.org/project/upgrade_status
• Coder – drupal.org/project/coder• Module Builder – drupal.org/project/module_builder• Advanced Help – drupal.org/project/advanced_help
![Page 20: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/20.jpg)
Or migrate...Sometimes the easiest thing is to rebuild the
site from scratch and migrate content and users
![Page 21: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/21.jpg)
Security concerns• When migrating content, you risk exposing your
data to the outside world• Especially true with custom migration – using
XML/feeds to export data may be open to anyone• Best practice is to migrate from a local snapshot
of production
![Page 22: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/22.jpg)
Tools to migrate• Migrate – drupal.org/project/migrate• Backup and Migrate –
drupal.org/project/backup_migrate• Custom development – sometimes to meet the needs
of your site, you’ll need to do some custom migration
![Page 23: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/23.jpg)
Migrate includes:• API for building a complete migration• Drush commands that use Batch API• Migrate UI• Migrate Example – See how Migrate module is
implemented with a working example• Documentation – drupal.org/node/415260
![Page 24: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/24.jpg)
Backup and Migrate
• Selectively choose database tables to migrate• Doesn’t handle relational data like User Profiles• Perfect for porting custom tables that won’t
change
![Page 25: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/25.jpg)
Custom migration• Often, data must be exposed to pull content and users• Exportable data via Views• Feeds – import data in a variety of formats• Many contributed Feeds modules that extend Feeds’
parsing capabilities
![Page 26: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/26.jpg)
Database connections
• Table prefixing in settings.php – ‘other_database.’ as a prefix
• Switch database connections with db_set_active() – watch for errors and Schema API caching
![Page 27: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/27.jpg)
Database prefixing$databases['default']['default'] = array( 'prefix' => array( 'default' => '', 'users' => 'shared.', 'sessions' => 'shared.', 'role' => 'shared.', 'authmap' => 'shared.', ),);
![Page 28: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/28.jpg)
Other considerations
• Security – don’t expose your data, especially users • PHP timeout and memory settings• Make backups and database dumps at every
milestone• drush sql-dump > backup.sql
![Page 29: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/29.jpg)
Files migration• Backup and Migrate Files –
drupal.org/project/backup_migrate_files• Recent Files – drupal.org/project/recent_files• rsync• Drupal 7 introduces public and private files• drupal.org/documentation/modules/file
![Page 30: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/30.jpg)
Questions?
![Page 31: Taking your site from Drupal 6 to Drupal 7](https://reader035.fdocuments.net/reader035/viewer/2022062513/554f3746b4c90572088b4cc9/html5/thumbnails/31.jpg)
Contactthagler@phase2technology
@phase2tech703-548-6050
d.o: tobby