Hi,
I am new to drupal and migrate module and want to use migrate module to migrate a website from asp.net to drupal. For this i have analysed the code of the beer and wine examples provided with migrate module and also made changes in the code so as to see any change in the drupal UI. But unfortunately, even after changing the name of the content types in both Beer and Wine example codes, there is no change seen on the drupa UI. May be the files named beer.inc and beer.install.inc are not the ones affecting the content types on druapl UI(correct me if I am wrong). Please help me with the control flow of the migrate module so that one can know the code to be modified to actually see the changes on the drupal UI.
Thanks a lot in advance.
Comments
Comment #1
drewish commentedIf you're doing your own migration I'd suggest putting it in a custom migration module. Look at http://drupal.org/node/1006982 for how to implement hook_migrate_api(). Make sure you put the .inc files into your .info file so Drupal knows about them. Clear the cache and you should start seeing the migrations listed. Also be aware that your module will need to be enabled before the migrations will appear.
Comment #2
mikeryanWhen you say you're not seeing change in the "Drupal UI", where are you looking? If you change the content types in the migration code (beer.inc and wine.inc), that only affects the migration - you would only see the changes under /admin/content/migrate/BeerNode, for example - that would not affect the content types that are defined in Drupal under /admin/content/types. If you changed beer.install.inc after installing the migration module, that would have no effect - the installation code is only run on the initial enabling of a module, changes to it afterwards will have no effect.
If you're new to Drupal, the Migrate module is not the place to start learning - to understand its code you need to already have a pretty good handle on Drupal module development. You would be better off starting from the developer documentation, or one of the fine books on the market like The Definitive Guide to Drupal 7, Pro Drupal 7 Development, or Drupal 7 Module Development.
Comment #3
dreamriks commentedhi
I thought i understood what was to be done to make drupal know about my migration. I made a folder named "mera" in the the migrate folder and defined the "mera_migrate_api" function for that in the "mera.module" file and also made a file named "product.inc" that consisted of the classes "MeraProductMigration extends Migration" and ProductUserMigrtaion extends MeraProductMigration" and also listed "product.inc" file in "mera.info file". Still my migration is not visible in drupal. I was unable to figure out the reason so i thought of removing the "migrate_example" folder from migrate folder to see whether it has any effect on the drupal UI. But amazingly there was no effect. Drupal was still showing all the beer and wine migrations inspite of complete removal of migrate_example folder from migrate folder. I also cleared the cache many times,restarted the server and even restarted the computer. What is the Problem. Please help me out......I trust the fact that to make drupal aware about my migration i need too define a mymigrationname_migrate_api() which i did alongwith .info and .inc files.
Comment #4
dreamriks commentedHi,
I figured it all out and now its all working fine. Thank you so much for helping me out.
Rishi
Comment #6
navneet.rawal commentedHi dreamriks, I'm having the same issue of not seeing my classes in the migrate UI/drush migrate-status. Do you mind sharing what was going wrong and what you figured out? Thanks in advance.
Comment #7
dreamriks commentedHey navneet
I think the problem with my code was that the way I was hooking the migrate module was not correct. So all I did was, made a new module and followed each step of hooking the migrate module correctly and it worked.
While using migrate module you might feel that you have done everything correctly but there's some small problem that causes this problem. Just make sure you write everything to perfection in the .module file and the .info file and it will be visible in the module list.
Comment #8
dreamriks commentedMaybe you can post your code here and we can look at it.