# Code versions, WebDAV upload and dw.json

*B2C Commerce Developer Study Guide · B2C Commerce Setup · Last updated November 3, 2026 · https://www.certifyforce.com/study-guide/b2c-commerce-developer/b2c-commerce-setup/code-versions-webdav-upload-and-dw-json*

How realms, instances and code version directories fit together, how dw.json and the sgmf-scripts npm commands push cartridges over WebDAV, and how activation, rollback and Code Replication decide which code actually runs.

- Certification: Salesforce B2C Commerce Developer
- Exam section: B2C Commerce Setup
- Study guide: https://www.certifyforce.com/study-guide/b2c-commerce-developer

**Official exam objective:**

> Given a sandbox environment, configure an IDE to use WebDAV to deploy cartridges to the correct version directories.

## What the exam expects

- Describe a realm and its instance types (sandbox, staging, development, production) and say which ones accept direct code uploads.
- Configure `dw.json` so the upload tool reaches the right instance and the right version directory, and pick the `sgmf-scripts` npm command for the job (whole repository, one cartridge, one file, watch).
- Reach a code version over WebDAV with Business Manager credentials and know where Business Manager lists every WebDAV URL.
- Activate, roll back, add and delete code versions on the Code Deployment page, and fix "my upload didn't show up".
- Move a release from staging to production with an inactive version and Code Replication.

Key terms: **realm** (the set of instances you develop, test and run sites on); **code version** (a folder of custom cartridges); **active code version** (the one the instance runs); **compatibility mode** (an API version activated with its code version); **Code Replication** (copies the active code version from staging to production or development).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| What an instance runs | Only the active code version | [Code Deployment](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-code-deployment.html) |
| Activation side effect | Cached items are cleared | [Code Deployment](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-code-deployment.html) |
| Rollback | Activates the previous version and its compatibility mode; fails if it was deleted | [Code Deployment](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-code-deployment.html) |
| Code version retention | 3 to 20, default 10; active and previously active never removed | [Code Deployment](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-code-deployment.html) |
| dw.json location | Repository top-level folder, sibling of `cartridges` | [Get Started with SFRA](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-build-sfra.html) |
| dw.json keys | `hostname`, `username`, `password`, `code-version` | [Upload and configure cartridges](https://trailhead.salesforce.com/content/learn/modules/b2c-cartridges/b2c-cartridges-upload-configure) |
| WebDAV login | Business Manager username and password | [Cartridges](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-cartridges.html) |
| Selected code version file | `.../Cartridges/.version` | [Cartridges](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-cartridges.html) |
| Node.js in SFRA | Version 18 tested; used only for npm dependency management | [Get Started with SFRA](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-build-sfra.html) |
| Code Replication | Copies the active version from staging to production or development | [Code Deployment](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-code-deployment.html) |

## Check yourself

- Why does B2C Commerce install Node.js for SFRA?
- When does a code version show no activation time on Manage Code Versions?
- Which names does Business Manager refuse when you create or rename a release folder?
- Why must you write `dw.json` yourself for the cartridges that ship with SFRA?

## Sources

- [Code Deployment](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-code-deployment.html)
- [Upload and configure B2C Commerce cartridges for dev](https://trailhead.salesforce.com/content/learn/modules/b2c-cartridges/b2c-cartridges-upload-configure)
- [Get Started with SFRA](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-build-sfra.html)
- [Cartridges](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-cartridges.html)
- [Customize cartridges: override templates and controllers](https://trailhead.salesforce.com/content/learn/modules/b2c-cartridges/b2c-cartridges-customize)
- [B2C Commerce Architecture](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/get-started.html)
- [Develop With Your On-Demand Sandbox](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-develop-with-on-demand-sandbox.html)
- [Salesforce Certified B2C Commerce Developer Exam Guide](https://help.salesforce.com/s/articleView?id=005298941&language=en_US&type=1)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 7 linked practice questions, and unlimited timed mock exams are included with the B2C Commerce Developer pack (USD $19): https://www.certifyforce.com/practice-exams
