0

I'm working on an upgrade process, and I've noticed something strange when I upgrade my D6 site to 7. I've noticed some behavior that's kinda odd, and was wondering if anyone one else had experienced something similar in their upgrades.

1: Some users have the their avatars in the "file_managed" table, uri field set to: sites/default/files/user-pictures/...

These are the correct pictures, but they won't work with image styles unless I switch the value of uri to be the correct uri format. Any ideas why some of the images wouldn't get switched to the proper uri formate durring a 6-7 upgrade?

2: Some users have the completely wrong avatar. The avatars aren't even necessarily other user's avatars, though some of them are, but some are just images from site pages. For example, user 55 in D6 had an avatar at picture-55. After upgrading, I find no record of an image with the file name of picture-55 in file_managed, the user table says his user image is set to a file with an fid of 20, which is in attached images.

I've got a lot of users, so making sure the avatars mach up correctly is important. I would appreciate any help in figuring what's causing this/how to fix it.

2 Answers 2

1

Drupal 6 did not have {file_managed} at all. Also, user profiles wasn't really fieldable. And both styles and fields changed between 6 and 7. 3 big changes affecting one value - that's bound to create problems.

To get around it, you can use Views Data Export to expose users from old site, and then import your users back using for example Feeds

Import or aggregate data as nodes, users, taxonomy terms or simple database records.

with Feeds Image Grabber

an addon for Feeds module, which grabs image for each feed-item from their respective webpages and maps it to an image field

0

Thanks to Molot for his help with this, I was able to do a few things in order to get this to work, so I figured I would write down exactly what I did in order to get everything set (incase I need to refer back on it, or if anyone else needs it.)

  1. First, I used MSQL workbench to download the D6 User table. I grabbed the whole thing, but really I only ended up using uid, name, picture and mail. It would probably be best if I had left the password field, but as this is a test on my local machine, I figured it was ok to just grab everything for now.

  2. Switching back to my D7 instance, I downloaded Feeds, Feeds Image Grabber, and Feeds User Picture Mapper (note, feeds does not handle user images, and you need this module that's only a few lines long. I had to patch it to get it to work, the patch is covered here :https://drupal.org/node/1734398 )

  3. This part's kina kludgy, but forever reason I found myself having to download the images from somewhere other than the local environment, so I had to go and make sure all the relative paths in my CSV were pointing to my prod box. Not sure if this was absolutely necessary, but it's what worked for me.

  4. I then created my importer for the users. It is important to make sure the User processor setting is set to UPDATE existing users users. Also, make sure the CSV mapping is all set.

  5. Run the processor.

  6. Viola! Users now have their correct user images.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.