• Resolved OC2PS

    (@sooskriszta)


    I am moving my BuddyPress site from rtMedia to MediaPress.

    I have copied the files over to the MediaPress file structure.

    I have created mediapress gallery posts for all users and attachment posts with those galleries as parents.

    I have also created post meta records for the galleries with mpp_component_id set as member id and _mpp_unpublished_media_id set as the attachment id.

    But in the frontend, I still don’t see any galleries under any users. All users have 0 galleries listed.

    What am I missing?

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter OC2PS

    (@sooskriszta)

    P.S. In the backend when I go to MediaPress > All Galleries, I do see galleries listed there, as well as their “created by”.

    Plugin Author Brajesh Singh

    (@sbrajesh)

    Hi Vivek,
    Do you still have the backup of old data?

    There are 2 ways to do the migraton. I will suggest using the MediaPress Import APi to do it without worrying about the associations.

    It is possible to do it manually but that needs a lot of extra meta/taxonomy associations.

    A few things to note:-

    1. Copying file structure is not needed. It may cause issue with your existing media(WordPress stores relative path in meta)
    2. Depending on whether the import is a WordPress attachments(we only need to add extra meta in this case) or a raw file(any file on server), the process of import differs.

    I will outline the process of importing here.

    1. We create atleast one gallery for each of the user(currently MediaPress needs a gallery, RT Media can work without that too).
    You can either manually create it or use mpp_create_gallery() to do it. Please search on BuddyDev forum for examples on mpp_create_gallery. We have many examples there.

    Here is what happens:- A post in mpp-gallery post type is created. The post is assigned the terms from 3 taxonomies( this changes in 1.5 and we will have auto migration) for privacy, component, and type. All these terms have their slug prefixed by underscore to avoid any conflict.

    Once we are done with it, we add 1 extra meta ( _mpp_component_id ) which is a numeric value and it contains the user_id or the group id to which this gallery is associated.

    If you use mpp_create_gallery(), It will take care of all of this and will be future proof too.

    For importing a media to a gallery, we provide two options
    https://buddydev.com/mediapress/media/importing-file-mediapress-gallery/
    or
    https://buddydev.com/mediapress/media/import-wordpress-attachment-mediapress-gallery/

    If you want to do it manually, we will need to associate terms(same as gallery) and add 2 extra meta( _mpp_is_mpp_media, _mpp_component_id).

    If you need further assistance, Please do let me know.

    Regards
    Brajesh

    Thread Starter OC2PS

    (@sooskriszta)

    Thanks Brajesh.

    I do not have a backup of the original database, so I have to deal with the mess I have created, i.e. do it manually.

    About the 2 meta
    _mpp_is_mpp_media should be created for all attachments, and the value should be set as 1
    _mpp_component_id should be created for each gallery and each attachment, and the value should be the userid
    Am I correct?
    I already did both yesterday. But can’t see the galleries listed on the frontend.

    Is it possible that MediaPress things these galleries are general “sitewide” galleries (though it knows who created them), not user/xprofile galleries and that’s why they don’t show up under user profiles but do show up in the backend when I go to All Galleries? If so, how do you determine whether it is sitewide or user gallery? What database entry would help me fix this?

    Thread Starter OC2PS

    (@sooskriszta)

    Also, I notice that, in the backend WP Admin > MediaPress > All Galleries
    For each gallery, there is a correct “Created by” value in the column.
    But when I hover on gallery name and click on View, the view link goes to my profile, i.e.
    https://Domain/myusername/mediapress/correct-gallery-slug
    instead of
    https://Domain/creatorusername/mediapress/correct-gallery-slug

    Irrespective visiting that link takes to the MediaPress Gallery page which shows “There are no galleries available!”
    I have tried substituting the owner username for mine in the URL, but still same result “There are no galleries available!”

    Thread Starter OC2PS

    (@sooskriszta)

    The post is assigned the terms from 3 taxonomies( this changes in 1.5 and we will have auto migration) for privacy, component, and type.

    I think that’s what I am missing. Can you share details?

    Thread Starter OC2PS

    (@sooskriszta)

    Yup, that was it. So, I added term taxonomy relationships, adding user gallery, public gallery and photo gallery to each gallery. Now I do see galleries appear under each user correctly.

    The problem is that on the frontend, when I click on the gallery name, there is nothing inside the gallery. The photos have post type attachments related to them. And the parent is set as gallery ID. What am I missing? Are there any taxonomies required for the photos too?

    Thread Starter OC2PS

    (@sooskriszta)

    I have added the 3 taxonomies to the images as well. Still no luck – the frontend galleries still don’t show any photos.

    Thread Starter OC2PS

    (@sooskriszta)

    I am missing the metas _wp_attached_file and _wp_attachment_metadata for the images.

    Are they important? I know _wp_attached_file contains a relative path to file, but so does the post record under guid. Please advise.

    Thread Starter OC2PS

    (@sooskriszta)

    Oops…sorry, actually I do already have _wp_attached_file so am missing only _wp_attachment_metadata

    Plugin Author Brajesh Singh

    (@sbrajesh)

    Hi Vivek,
    My apologies for the delayed reply. I will be assist better from upcoming Monday.

    Here is what we do on single gallery page

    1. We search for all attachments which have
    a. component set to current component( members/groups/sitewide) based on context
    b. component_id set to current component(user_id in case f members/sitewide, group_id in case of groups).
    c. post_parent set to current gallery id.
    d. status(status taxonomy is set and has value that allows access to current user). The type/component taxonomy is set properly too.
    e. _mpp_is_mpp_media meta is set to 1

    That fetch the collection.

    Correct value for _wp_attached_file and _wp_attachment_metadata is required to access the for correct media file. It is used by WordPress. If you have moved files manually, It will need to be updated. I suggest updating _wp_attached_file and then regenerating the meta data.

    Regards
    Brajesh

    Thread Starter OC2PS

    (@sooskriszta)

    Thanks! That helped sort it out.

    Plugin Author Brajesh Singh

    (@sbrajesh)

    Thank you for the reply. I am glad it helped.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Migration issue’ is closed to new replies.