• Resolved David

    (@dlim_vernier)


    BACKGROUND
    This may be a very specific migration question.

    I’m trying to migrate a database of users and their associated downloads into WooCommerce. There are almost ~150,000 users.

    The existing database is WordPress, so I have the same WordPress user ID to use. I also used wp_usermeta with a simple key and a SKU as the meta value.

    Example in wp_usermeta:

    • user_id: 1
    • meta_key: “software_license”
    • meta_value: “STAR”

    I’ve looked over the WooCommerce documentation and it seems like the relationship between downloads and orders is required. I’m hoping not to generate an order per user in order to give them access to their downloads in this migration.

    QUESTIONS

    1. Is scripting an order per user for their downloads the only option? Or can I create one giant order to handle it all so I don’t have fifty thousand rows of orders?
    2. In the woocommerce_downloadable_product_permissions database table, how is the download_id generated?
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there! I can’t answer your second question, but I can answer the first one: An order per user is required for downloads for that user. There is no way to associate a downloadable file with a user directly in WooCommerce, so it has to be done via an order, and orders are always associated with a single user.

    One way of avoiding this would be to use something like WooCommerce Memberships to create membership plans, and then create pages where members of that plan can download specific files that they previously had access to. You could then assign users to those membership plans to give them access to the files. That way you wouldn’t have a bunch of orders.

    I don’t know that this would actually simplify things all that much, though. Apart from the strange user experience of becoming members to download files they previously had access to, you would then have a bunch of memberships in your database instead of a bunch of orders, so you would likely end up with a similarly unwieldy amount of data.

    Thread Starter David

    (@dlim_vernier)

    Thanks Austin! I appreciate the time you took for your answer. I ended up modifying the account download page to look at WooCommerce downloads and my own customer user meta. The output is a blend of both.

    Ah, that works! Glad you were able to figure out a work-around!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Migrating User Account Downloads’ is closed to new replies.