# Manage Module Versions

Module versions allow you to update a module's form structure over time without losing existing response data. Each version is a snapshot of the module's sections, fields, and options. The module detail page displays the version history and provides tools for creating new versions and migrating data.

## Version History

The module detail page lists all versions with their status:

* **Live** — The currently published version.
* **Draft** — A work-in-progress version not yet visible to users.
* **Scheduled** — A version scheduled for future publication.
* **Previous** — Older versions that are no longer live.

Each version entry shows the version number, name, publish date (if applicable), version notes, and the number of responses collected.

## Create a New Draft Version

To update a module's form structure, create a new draft version:

{% stepper %}
{% step %}

#### Navigate to the module detail page

From the Module Builder list, click on the module to open its detail page.
{% endstep %}

{% step %}

#### Click Create New Draft

Click the **Create New Draft** button. PEARS copies the current live version's sections, fields, and options into a new draft.

{% hint style="warning" %}
**NOTE:** You can only create a new draft if no draft currently exists. If a draft is already in progress, edit it instead.
{% endhint %}
{% endstep %}

{% step %}

#### Edit the draft

The new draft opens in the [form builder](/administration/administration/module-builder/build-a-form.md). Make your changes — add, remove, or modify sections and fields as needed.
{% endstep %}

{% step %}

#### Publish the draft

When the draft is ready, [publish it](/administration/administration/module-builder/publish-a-module.md) to replace the current live version.
{% endstep %}
{% endstepper %}

## Migrate Response Data

When you publish a new version that changes the form structure, existing responses remain associated with the version they were created on. Data migration allows you to move responses from an older version to a newer version, mapping fields between the two.

{% stepper %}
{% step %}

#### Start a migration

From the module detail page, click **Migrate Responses** on the version you want to migrate data from.
{% endstep %}

{% step %}

#### Select records

Choose which responses to include in the migration. You can select all responses or pick specific records.
{% endstep %}

{% step %}

#### Configure field mappings

Map fields from the source version to fields in the target version. PEARS automatically maps fields with matching slugs. For fields that changed between versions, manually select the corresponding target field.
{% endstep %}

{% step %}

#### Review and confirm

Review the migration summary showing the number of records and field mappings. Click **Confirm** to start the migration.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
**NOTE:** Publishing a new version cancels any pending migrations for the module. Complete all migrations before publishing a new draft.
{% endhint %}

## Delete a Version

To delete a previous version, click **Delete** on the version entry in the module detail page. Deleting a version removes the version record but does not affect responses that have been migrated to other versions.

{% hint style="warning" %}
**NOTE:** You cannot delete the live version. To remove the live version, unpublish it first or publish a new version to replace it.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.pears.io/administration/administration/module-builder/manage-versions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
