mediatribe.net -- Drupal and Web Development

Notice: this post was last updated 6 years 15 weeks ago so it might be outdated. Please be cautious before implementing any of suggestions herein.

how to upgrade a module to drupal 7

Here are some step-by-step instructions on how I upgrade modules from d6 to d7:

drush dl coder
drush dl grammar_parser
drush en coder_upgrade

put the latest 6.x version of the module into sites/mediatribe.net/files/coder_upgrade/old

go to admin/config/development/coder/upgrade

click the checkbox next to the name of the module you are upgrading to d7

click convert files

make sure there are no error messages

click on the module name

now you are looking at the patch

get the latest 6.x CVS version of the module into sites/all/modules

manually copy all the files from sites/mediatribe.net/files/coder_upgrade/new/the_module/ to sites/all/modules/the_module/

enable your module

test it to make sure it works, and make any necesssary changes

cd into your module directory

cvs diff -up > patch.patch

move patch.patch out of the module directory

move the module directory to a safe place

download a new copy of the latest version of the module

apply your patch to make sure it works

While executing `drush en

While executing `drush en coder_upgrade`, you may get an error like this:

No release history was found for the requested project (gplib).
Module coder_upgrade cannot be enabled because it depends on the following modules which could not be found: gplib

This is confusing because the module is called "grammar_parser_lib" and the required library is "grammar_parser". In order to solve the error, do this after downloading coder:

1- Install http://drupal.org/project/grammar_parser_lib (the Grammar Parser Lib module) to /sites/all/modules (as a module).

2- Install http://drupal.org/project/grammar_parser (the Grammer Parser, a mixed-use project) to /sites/all/libraries (as a library). You will need the Libraries module enabled.

Also, nothe that you will need the PHP_CodeSniffer Pear library. To check if it's installed, run:

pear list

If not, just execute:

sudo pear install PHP_CodeSniffer

After this, you should be able to complete the rest of the guide.

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h3>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.