> For the complete documentation index, see [llms.txt](https://docs.cuxial.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cuxial.com/scripts/getting-started/updating.md).

# Updating a script

Move a Cuxial script to a new version without losing your configuration.

Updating means replacing the script's folder and carrying your own changes into the new one. This page lists which files are yours and the order to follow.

## Which files are yours

These files are open and meant to be edited. Everything else is replaced on every update.

| File                | What it holds                                                                |
| ------------------- | ---------------------------------------------------------------------------- |
| `shared/config.lua` | The script's options.                                                        |
| `data/*.lua`        | Editable data: lists, locations, catalogs. Not every script has this folder. |
| `locales/*.json`    | Interface and notification texts.                                            |

The `install/` folder, where present, contains SQL and item definitions. You run or copy them; you do not edit them in place.

## Steps

{% stepper %}
{% step %}

## Read the changelog

Open the [Changelog](https://docs.cuxial.com/changelog/) and read every entry between your version and the new one. Look for new configuration options, new SQL and new dependencies.

Your current version is the `version` line in the script's `fxmanifest.lua`.
{% endstep %}

{% step %}

## Back up

Copy the whole script folder somewhere outside `resources`. If the update includes SQL, back up the database too.

{% hint style="danger" %}
Do not keep the backup inside `resources`, even renamed. The server can load it as a second copy of the script.
{% endhint %}
{% endstep %}

{% step %}

## Update Cuxial Bridge first

If a newer Cuxial Bridge is available, update it before the script. See [Cuxial Bridge](/scripts/getting-started/cuxial-bridge.md#updates).
{% endstep %}

{% step %}

## Replace the script

Delete the old folder and copy in the new one. Do not copy the new version over the old folder: files removed in the new version would stay behind.
{% endstep %}

{% step %}

## Bring your changes back

Do not paste your old files over the new ones. A new version can add options, and an old `shared/config.lua` would be missing them.

Open your backup next to the new files and carry over your values:

* `shared/config.lua` and `data/*.lua`: start from the new file and re-apply your changes.
* `locales/*.json`: start from the new file and re-apply your texts. Keys added in the new version keep their default text.

A file comparison tool makes this quick.
{% endstep %}

{% step %}

## Run new SQL

If the changelog mentions database changes, run the files it names from the `install/` folder.
{% endstep %}

{% step %}

## Restart the server

Restart the whole server, not only the resource. A full restart is the only way to be sure every player gets the new files.
{% endstep %}

{% step %}

## Check the consoles

Watch the server console while it starts and open the F8 console in game. No errors from the script in either means the update is done.
{% endstep %}
{% endstepper %}

## If something breaks

Restore the backup folder, restore the database if you ran SQL, and restart. Then look for the error in the script's Troubleshooting page or in [Help](https://docs.cuxial.com/help/).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cuxial.com/scripts/getting-started/updating.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
