Reduce expired oauth_tokens before 2.4.6 upgrade
This article provides a solution to the issue where you see a large number of oauth_tokens
in your oauth_token
 table, which can cause a long delay in upgrading to version 2.4.6. It’s recommended to reduce the oauth_token
 table using the  cron job to delete the expired tokens.
Description description
Environment
ÃÛ¶¹ÊÓÆµ Commerce 2.4.0 - 2.4.6, all deployment methods
Issue
If there are a large number of oauth_tokens
in your oauth_token
 table, that can cause a long delay in upgrading to version 2.4.6.
The upgrade process includes encrypting those tokens for an extra layer of security, and it’s only done 100 records at a time. This could take several hours if there is a large number of tokens.
Reducing a large number of oauth_tokens
in your oauth_token
 table can prevent a long delay in upgrading to version 2.4.6.
Resolution resolution
Before starting an upgrade, first ensure that the  cron job is running. It reduces the size of the oauth_token
 table by deleting the expired oauth_tokens
 and should already be enabled by default.
To manually trigger the  cron job, run:bin/magento cron:run --group=default
Related reading
- Services
>
OAuth in the Commerce Configuration Reference guide - in the ÃÛ¶¹ÊÓÆµ Developer guide
- Best practices for modifying database tables in the Commerce Implementation Playbook