The Code Migrate module is designed to assist developers in migrating websites from Drupal 6 to Drupal 7. It carries out a detailed analysis of the code base of the D6 site and outputs:
1. a list of modules involving a content type
2. a list of functions, methods, globals, and constants in a specified folder not found in D7
3. the lower bound of the lines of the code to rewrite for migration
4. a list of modules on the site with their versions
5. a list of modules on the site that have been integrated into D7 core
6. a list of modules implementing D6 hooks
This information can be used to estimate the coding effort for D6 to D7 migration for custom modules and for rewriting modules in D7.
Install the module and set permissions the usual way. Download and unzip the module, put it into your /sites/all/modules/contrib directory.
Enable it and set permissions to 'administer code migrate'.
To use, go to the module's settings at
/admin/settings/code_migrate
and set the directory for analysis. Save the settings. A list of checkboxes with modules to analyze will appear. Check off modules you want to analyze
and Save the settings.
To analyze click the ANALYZE MY CODE or Migrate links. You can also analyze by going to the URL at your site /code_migrate
On a large and/or slow site this may take a while.
If the module times out, consider analyzing fewer modules at a time.
Project:
http://drupal.org/sandbox/krylov/1635422
Git:
http://drupalcode.org/sandbox/krylov/1635422.git
Version:
D 6.x
Reviews of other projects:
https://drupal.org/node/1248326#comment-6231854
http://drupal.org/node/1591870#comment-6239566
http://drupal.org/node/1570804#comment-6239628
Reviews of other projects, round 2:
http://drupal.org/node/1678248#comment-6273574
http://drupal.org/node/1473540#comment-6274106
http://drupal.org/node/1468596#comment-6274794
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | drupalcs-result.txt | 167.49 KB | klausi |
Comments
Comment #1
rogical commentedManual review:
--------------------------------------
Comment #2
krylov commentedThanks for your suggestions, rogical. The branch name is now in Drupal convention. Also, I added the Git link and instructions on use.
Comment #2.0
krylov commented1. added 6.x-1.x branch, deleted older branches in Git
2. added Git link
3. added instructions on how to use the module
Comment #2.1
krylov commentedremoved caps
Comment #3
krylov commentedComment #4
olmeta.david commentedHi,
You have to correct your code with global recommandation.
You can use the tool in this URL : http://ventral.org/pareview
For example, all comments must be finished by a point, the comments function must specify "Implements" word instead of "Implementation".
Be careful about indentation in for() and if() blocks.
You have to use space for indentation and not tabs (line 44 and 45).
Don't use the t() function for menu item title, the system will add this for you.
Try to let some blank lines between instructions (for example, line 151 to 184).
Regards,
Comment #5
krylov commentedThanks, David. I removed the t() function and did some reformatting of comments. Good point about tabs. Those are now replaced with 2 spaces. Most modules I remember actually say "implementation". That and line spacing is a matter of taste.
Comment #6
krylov commentedComment #7
krylov commentedNow I am reading a module that uses "implements", actually.
Comment #7.0
krylov commented1. more details on how to set up and use the module
Comment #8
krylov commented3 reviews added.
Comment #9
misc commentedAssigning to me to do a manual review.
Comment #10
misc commentedAutomatic review: http://ventral.org/pareview/httpgitdrupalorgsandboxkrylov1635422git
Manual review:
variable_get('code_migrate_dir', './sites/all/modules')? Many sites does not use sites/all at allI can see that this would be quite heavy on memory on sites with al lot of modules, have you done some tests for that? Have you been thinking on using batch api?
Comment #11
krylov commentedHi MiSc,- thanks for your review. I'll do the code changes shortly.
1. The /sites/all/modules is where contrib modules reside by default, at least in my installation of PressFlow.
2. This modules runs for a couple of dozen seconds on an average server with about two hundreds of modules installed. It is meant to be run manually and its use of CPU and memory is appropriate for such a tool. I don't know if you've read the readme file, but basically this is a tool for migrating D6 sites into D7.
Comment #12
misc commented1 - Modules could be installed in other folders, so you should not count on it being in sites/all - it seems what you are looking for is something like:
drupal_get_path('module', 'code_migrate'), or?2 - Couple of dozens of seconds would lead to time outs on many servers - many developers do not develop locally (but they should...). I tried the module locally on a normal drupal 6 built for an customer and got error becuase of maximum execution time, I even tried to raise it to 120 seconds, but still got an timeout. That is why I ask about batch api. And yes I understand the purpose of the module...
Also I would suggest that you add a check all option for the module pageI tested it out, and you should add an option to mark all checkboxes.
Comment #13
krylov commented1. That is why I have this setting. The user can point the module to any directory they wish. However, it defaults to the most common dir to migrate. Pointing to the code_migrate dir would suggest that you want to migrate this module itself.
2. It benchmarks around 60 seconds on 60 modules on my laptop. My suggestion for timeouts is to uncheck some modules (I am going to mention this is README) and run the module in batches with fewer modules at a time. Batch API is a great but I think it's an overkill for this module. The effective solution is simply to run it in batches and combine results.
Comment #14
misc commented1 - Ah ok, misunderstand you usage there, but why do you need this one to be a variable then? And how about if you migrate from a profile , like Pressflow to just drupal 7?
2 - 60 modules is not so much on a regular drupal 6 site.
However, this issues should not be something that stops it for being RTBC.
Comment #15
krylov commented1. It pretty much doesn't matter what you start with. The module will go through any code base and point out what's not in D7. This goes for hooks, constants, globals.
2. That is true. I work with about 200 modules. I was able to analyze them in one run by setting the PHP timeout to 300 seconds.
3. I did some code changes and implemented a new feature, but I can't push them to the Drupal repository. The error I get is "Pushing to krylov@git.drupal.org:sandbox/krylov/1635422.git
To krylov@git.drupal.org:sandbox/krylov/1635422.git
! [rejected] 6.x-1.x -> 6.x-1.x (non-fast-forward)
error: failed to push some refs to 'krylov@git.drupal.org:sandbox/krylov/1635422.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details."
Any idea?
Comment #16
krylov commentedI resolved the git issue and pushed the code changes.
Comment #17
klausiProject 1: http://drupal.org/node/1635464
Project 2: http://drupal.org/node/1556354
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
Comment #18
krylov commentedThank you for the clarification. I am sorry for opening the second application before the first one was promoted to full project. Please keep this application, Code Migrate http://drupal.org/node/1635464, running. It has already been reviewed.
Close the other one,
http://drupal.org/node/1556354
Comment #19
Robin Millette commentedswapping...
RTBC as set in #1635464-14: [D7] Code Migrate.
Comment #20
krylov commentedThanks. Right on.
Comment #21
klausiThere is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732
Review of the 6.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #22
krylov commentedHi Klausi,- thank you for your further suggestions.
I reset the default branch to 6.x-1.x and deleted the master branch.
1. ran Coder and reformatted
2. corrected
3. this module does not edit code. Its main purpose is to plan a migration. It also does several thing the Coder module doesn't do so far as I know. It finds content type usage in code, lists all modules with versions, lists all hook calls. It also download D7 versions of the site's modules and lists all that are available. All these make it much better suited for a migration assessment. It is also light weight.
4. moved into the function's body (is this to increase speed while bootstrapping?)
5. corrected
6. corrected
7. prefixed with the module's name
8. Used lower case
9. In some cases the permission can be set for an anonymous user as well if the admin want a visitor to use the module's output.
Comment #22.0
krylov commented+3 reivews
Comment #22.1
krylov commented+review
Comment #22.2
krylov commented+review
Comment #23
krylov commentedComment #24
mitchell commentedThanks for your contribution, krylov!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on irc in #drupal-contribute. So, come hang out and stay involved! Thanks again, and good luck! :)
Comment #25
patrickd commented@Mitchell, you just fixed an application that was RTBC'd by the applicant himself..
please pay more attention on that next time
Comment #26
mitchell commented@patrickd: no, no. I was going off of #14. None the less, I'll join #code-review now to receive my proper chiding if you're available ;)
Comment #27
patrickd commentedmaybe later ;-)
Comment #28
krylov commentedpatrickd,- thanks for updating my account and for the links. I'll check them out as well as the irc:)
Comment #29
krylov commentedHi mitchell,-
for some reason I get "access denied" when I go to create new project page. Is this something to do with my account? Thanks!
Comment #30
patrickd commentedeveryone gets this at the moment, probably site-maintenance.
Comment #31
krylov commentedI see, I see.
Comment #32.0
(not verified) commented+review
Comment #33
avpaderno