How to recover access tokens for shops that only exist in one collection (appearance settings), not

Topic summary

A developer is migrating from an old Shopify custom app to a new Remix-based app with theme app extensions and faces a critical data inconsistency issue.

Core Problem:

  • AppearanceSetting collection contains 7000+ shops with customization data
  • Shop collection (containing access tokens) has only 4000 entries
  • ~3000 shops have appearance settings but no corresponding access tokens

Key Questions:

  1. Token Recovery: Can access tokens be regenerated or retrieved for the 3000 missing shops using only their shop domain (e.g., myshop.myshopify.com)? Is secure re-authentication possible via App Bridge or embedded UI?

  2. Migration Strategy: How to automatically apply old appearance settings to migrated customers (7000 shops) through the Theme App Extension, while applying default settings for new installs?

Technical Context:

  • New app uses Theme App Extension (TAE) for appearance settings instead of database storage
  • Need programmatic solution to inject legacy customization data into TAE blocks

Status: Seeking community guidance on secure token retrieval methods and automated migration approaches for theme extension data.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

Hello Shopify Community,

We recently built a new Shopify app using Remix and theme app extension, which replaces our older custom app. In the old app, we used to save:

  • shop and accessToken in a Shop collection

  • shop and appearance customization data in an AppearanceSetting collection

? Problem:

We have the following issue during data migration:

  • Our AppearanceSetting collection has 7000+ shops

  • Our Shop collection has only 4000 shops

  • That means around 3000 appearance settings exist without a corresponding shop/access token entry

Now, for migrating data to the new app, we need to:

:red_question_mark: Questions:1. Is it possible to get or regenerate the accessToken for those 3000 missing shops if we only have their shop domain (like myshop.myshopify.com) but they don’t exist in our old Shop collection?

  1. If yes, then what is the correct way to regenerate or retrieve the access tokens securely for those existing users? Can we trigger re-authentication?

  2. For the new app, we’re now handling all appearance settings via the Shopify Theme App Extension (TAE) instead of saving it in the database.

    So, we want to:

    • Automatically apply the old saved appearance settings for migrated customers (those 7000 shops)

    • Apply default appearance settings for new installs via the TAE

What We Need Help With:- Can we programmatically regenerate or retrieve access tokens for existing merchants just by having their shop domain?

  • Is there a secure way to re-auth them via the app bridge or embedded UI?

  • How to inject old appearance data into the Theme App Extension block automatically for migrated users without database reliance?

Any guidance or suggestions would be highly appreciated!

Thank you! :folded_hands: