# Duplicate the Theme Before You Touch Code, Every Single Time

Source: https://storesetupmanual.com/blog/2026-11-20-duplicate-theme-before-editing-code-backup-habit.html

Reviewed November 20, 2026


Every store has a story about a small code edit made directly on the live theme: a snippet pasted for an app, a line changed in the product template, and then a layout broken in a way nobody can reconstruct because nobody remembers the before state. Shopify gives you a one minute insurance policy against that story. Most stores skip it because the edit feels too small to break anything.

Duplicating the theme copies the entire codebase and settings of the theme as it stands. That copy is your restore point and your diff reference. The edit is never too small. The question is only whether the store can afford the version of the afternoon where the small edit was the wrong one.

## The habit, made mechanical

Before any code session: duplicate the live theme, rename the copy with the date and a two or three word reason, then do the work. If you are testing a change rather than fixing one, work in a fresh duplicate instead and keep the live theme untouched until the change is approved. Two different jobs, two different copies, and the naming is what keeps them straight.

Mind the theme library limit, which caps how many themes an account can hold, varying by plan. A library full of undated duplicates named Copy of Copy is the failure mode of the habit itself. Prune old working copies once their changes are live and stable, and keep the dated restore points for the changes that mattered.

## What a duplicate does not back up

A theme duplicate captures code and theme settings. It does not capture everything a store depends on: app settings live with the apps, checkout customizations configured outside the theme live elsewhere, and content like products and pages is not part of the theme at all. Know the boundary, because the worst version of the backup mistake is discovering it during the restore.

For changes with wider blast radius, an app install or a checkout change, the theme copy is one layer. Pair it with a written note of what else changed that day. The note is unglamorous and it is the document every postmortem wishes existed.

## Restoring without panic

When an edit goes wrong live, the restore is publishing the clean duplicate, which returns the storefront to the before state in the time it takes to click publish. Then debug the broken copy offline, at human speed, instead of reverse engineering a snippet while customers watch the store misbehave.

That sequence only works if the duplicate predates the edit. A copy made after the breakage is a photograph of the problem. The whole system is the order of operations: copy first, edit second, and no exceptions for edits that feel trivial, because trivial is the word in every one of the stories.

[Your Store Email Needs SPF, DKIM, and DMARC Set on Your Own Domain](https://storesetupmanual.com/blog/2026-11-19-store-email-spf-dkim-dmarc-shopify-domain-setup.md) and [Shopify Payments Payouts Run on a Schedule, and Reserves Are a Separate Event](https://storesetupmanual.com/blog/2026-11-19-shopify-payments-payout-schedule-reserve-basics.md) cover the nearby cases in this series.

## Frequently asked questions

### How do I duplicate a Shopify theme?

In the admin, go to Online Store, Themes, open the actions menu on the theme, and choose Duplicate. Rename the copy immediately with the date and the reason for the edit, so the library stays readable when you need the restore point under pressure.

### Does duplicating a theme back up my whole store?

No. It backs up the theme code and its settings. Products, pages, app settings, and checkout configuration live outside the theme and are not included. For wide ranging changes, pair the duplicate with a written note of everything else that changed.

### How many themes can I keep in the library?

Shopify caps the theme library, with the limit depending on your plan. Prune stale working copies once their changes are live and stable, and keep dated restore points for significant changes so the cap never forces you to delete the copy you actually need.

### What do I do if I already broke the live theme?

Publish the most recent clean duplicate to restore the storefront, then debug the broken theme as an unpublished copy. If no clean duplicate exists, use the theme file version history in the code editor to roll back individual files, which is slower and exactly why the duplicate habit exists.
