@by-association-only/theme-backup
v1.0.2
Published
Backup Shopify themes across multiple stores.
Readme
Theme Backup
A CLI tool to backup Shopify themes across multiple stores.
What it does
This tool helps you create backups of Shopify themes across multiple stores in your organization:
- Reads store URLs from a config file (
.bao-storesor.bao-translation-checker) - Shows interactive theme selection UI
- Checks theme limits and prompts for deletion if needed:
- At 100 themes: Forces deletion (must delete at least 1)
- Above 20 themes: Optional deletion prompt
- Backs up selected theme with naming:
[Original Name] (Backup YYYY-MM-DD) - Uses Shopify CLI
pullandpushcommands for duplication
Setup
- Add a config file in the root:
.bao-stores(or use existing.bao-translation-checker)
List each store name on a separate line (the part before .myshopify.com).
Example: If your stores are:
- acmestore.myshopify.com
- acmestore-us.myshopify.com
You would enter:
acmestore
acmestore-us- Run the backup tool:
npx @by-association-only/theme-backupUsage
The tool will:
- Process each store in your config file
- Check theme count and prompt for deletion if needed
- Show interactive theme selector
- Pull the selected theme to a temp folder
- Push it as a new unpublished theme with backup naming using the DD/MM/YYYY format
- Clean up temp files
Theme Limit Handling
The tool automatically checks your theme count and handles it as follows:
- 100+ themes: You've hit the maximum limit. The tool will force you to delete at least 1 theme before proceeding with the backup.
- 21-99 themes: You'll see a prompt: "You have X themes currently. Would you like to delete any?" You can choose to delete some themes or skip and proceed directly to backup.
- 20 or fewer themes: The tool proceeds directly to theme selection and backup.
Note: Shopify's theme limits are:
- Non-Plus stores: 20 themes maximum
- Shopify Plus stores: 100 themes maximum
Requirements
- Node v18.20+
- Shopify CLI v3.71+
- Valid Shopify store access
Issues
Authentication Required
If you see authentication errors, make sure you're logged into Shopify CLI:
shopify auth loginTheme Limit Errors
If you're at the theme limit, the tool will prompt you to delete themes before proceeding.
