• Resolved McTwist

    (@mctwist)


    I’ve read the existing topics in regards to importing user profile pictures, and it doesn’t look like people have had much luck. Here’s where I am:

    I copied the avatars folder full of the existing users’ pictures (that were originally uploaded via Buddypress) to the new site. The directory structure is wp-content/uploads/avatars/{user_id}/filename.png. I imported the users, and to my surprise, the user profile and Buddypress profile pages had images! But….incorrect images. For example, User ID 1597’s image actually belonged to User ID 688. They are all off.

    Do you know what could be causing this? I was so close!

    For reference, I have the Buddypress Profile Syncing option turned on.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Javier Carazo

    (@carazo)

    @mctwist,

    To import avatar for an users in every user you want to import you have to include in the bp_avatar, one of two:

    1. either the path or url of the photo
    2. or an integer that identifies the photo, not the user, so maybe that’s why you are confused. Each attachment creates a post in the post table and is assigned a post_id which is its attachment id and that would be the one you have to use.
    Thread Starter McTwist

    (@mctwist)

    Thanks. I’ve been looking through the database, and I haven’t seen anything new in the post table after adding a few new profile pics.

    What about when I’m exporting users? How do I make sure the CSV file has the fields that I will need for the avatars? I’ve tried exporting users, and I haven’t seen a “bp_avatar” field in the CSV file.

    I did notice, however, that if a user has a Gravitar pic, the correct picture is assigned after the import.

    Plugin Author Javier Carazo

    (@carazo)

    Sorry but I think you are very confused.

    For new records to be created in the post table you have to upload the files to the media library. Is that how you are doing it?

    Regarding the export, this is information that is not actually sent in the exported file.

    Thread Starter McTwist

    (@mctwist)

    No, I’m not using the media library. I’ve copied over the entire wp-content/uploads/avatars folder.

    I mentioned the export process because I wanted to find this “bp_avatar” field you mentioned. I know the images themselves don’t get exported ??

    Plugin Author Javier Carazo

    (@carazo)

    If you are not using Media Library, as in documentation is explained, you have to use the absolute path or url to upload files.

    And yes, of course you misunderstood me. I was telling you that bp_avatar does not appear in the export file. Not even the string as I was saying.

    The column does not appear as such because bp_avatar is not a standard metadata of a user, it is a complex data and we are preparing a quite big improvement of the plugin for BuddyPress that will include this among other things.

    Thread Starter McTwist

    (@mctwist)

    Good to hear about the upcoming improvement. You probably should have just led with that. There’s nothing wrong with saying, “I don’t know,” or “We’re still working on that.”

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Importing user avatars ALMOST worked’ is closed to new replies.