Skip to main content

How to migrate UBP users to NON-UBP

Prerequisites

  1. Production rails console

Step-by-step implementation

  1. Run rails console in production
  2. current_user = User.find(user_id)
  3. current_user.user_info.update(is_usage_based: false)
  4. Fallback::Cache.delete("user_id_#{current_user.id}_is_usage_based")
  5. Fallback::Redis.del("user_#{current_user.id}}_visits")
  6. Apps::PurgeCloudflareWorker.perform_async(current_user.apps.pluck(:id))
  7. In the plan write the needed plan current_user.upgrade_apps(plan)

Also ensure you delete visit counts row for the user:

ViewsCount.find_by_user_id(current_user.id).delete