> For the complete documentation index, see [llms.txt](https://axiomemu.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://axiomemu.gitbook.io/docs/guides/applying-updates.md).

# Applying Updates (1.x, manual)

How to install a hotfix or update bundle on an existing AXIOM-EMU server.

{% hint style="info" %}
This page is for version 1.x, plus the one-time [upgrade of a V1 database to V2](#upgrading-a-v1-database-to-v2-by-hand). From 2.0.0 the Server Manager installs updates for you: see [Updating with the Server Manager](/docs/guides/updating-with-server-manager.md).
{% endhint %}

When a new version ships, the customer portal lists a download. The download is a single ZIP that updates both the server and the client. This guide walks through installing it.

{% hint style="info" %}
The portal dashboard shows an "Update Available" banner once your servers fall behind the latest release. Required updates (security hotfixes, deadline-driven) close the running server with a popup; you must apply them before it will start again.
{% endhint %}

## 1. Download the bundle

[axiomemu.com/portal/updates](https://www.axiomemu.com/portal/updates) → click the latest version → **Download**. You'll get a file named like `axiom-update-1.0.1.zip`.

## 2. Read the release notes

Extract the ZIP somewhere outside your server install (e.g. `C:\AxiomUpdates\1.0.1\`). Open `NOTES.md` first — it lists what changed in this version and any special steps. If it says something like "schema change, run migrations", do not skip step 6.

## 3. Back up everything

{% hint style="info" %}
You can skip the database backup part if there are no migrations in the update.
{% endhint %}

Two things to back up before touching anything:

**Database** — in SSMS, right-click `muonline` → **Tasks** → **Back Up...**, or run:

```sql
BACKUP DATABASE [muonline] TO DISK = 'C:\AxiomBackups\muonline_pre_1.0.1.bak' WITH INIT
```

**Server install folder** — close all servers first (next step), then zip the entire install folder (e.g. `C:\AxiomServer`) and put the zip somewhere safe. Same for the client folder if Main.exe is changing.

If anything goes wrong in steps 4–7, restoring these two backups puts you exactly where you started.

## 4. Stop the servers

Open `Tools\ServerStartUP\ServerStartUP.exe` → **Stop All**. Wait until every row says it's not running. If you launched the EXEs by hand, close each console window and confirm there are no `GameServer.exe`/`DataServer.exe`/`ConnectServer.exe`/`JoinServer.exe` processes left in Task Manager.

{% hint style="warning" %}
Do not skip this. Overwriting an EXE while it's running either fails outright or corrupts the file on disk.
{% endhint %}

## 5. Apply the bundle

Inside the extracted update folder you'll see these subfolders. Each one tells you what to do with the files inside it:

| Folder in the update | What to do                                                                                                               |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `binaries/`          | Copy each file over the same path in your install. These are full replacement EXEs and DLLs — overwrite without merging. |
| `added/`             | Brand new files. Copy them into the same path in your install.                                                           |
| `changed/`           | Existing files that were edited. See "Reading a `.diff` file" below.                                                     |
| `removed/`           | Files that should no longer exist. Each `.removed` marker tells you which file to delete from your install.              |
| `migrations/`        | SQL files. See step 6.                                                                                                   |

Paths inside the bundle mirror your install. For example, `binaries/server/GameServer/GameServer.exe` goes to `C:\AxiomServer\GameServer\GameServer.exe`. `binaries/client/Main.exe` goes to your client folder's `Main.exe`.

### Reading a `.diff` file

For each changed file you'll see two entries — a `.new` and a `.diff`:

```
changed/server/GameServer/DATA/GameServerInfo - Command.dat.new
changed/server/GameServer/DATA/GameServerInfo - Command.dat.diff
```

* `.new` is the full new version of the file. If you have **never edited** this file yourself, just overwrite your copy with the `.new` and rename it back (drop the `.new` extension).
* `.diff` shows you exactly what was added and removed. Use it when you have customized the file and don't want to lose your edits.

A `.diff` looks like this:

```diff
--- server/GameServer/DATA/GameServerInfo - Command.dat (prev)
+++ server/GameServer/DATA/GameServerInfo - Command.dat (new)
@@ -1,8 +1,4 @@
 [GameServerInfo]
-;==================================================
-; Post Command Settings
-;==================================================
-CommandPostType = 4

 ;==================================================
 ; Add Point Command Settings
```

How to read it:

* `---` line is the old file, `+++` line is the new file.
* `@@ -1,8 +1,4 @@` says "this section starts at line 1; old version had 8 lines here, new has 4."
* Lines starting with `-` were **removed**.
* Lines starting with `+` were **added**.
* Lines starting with a space ( ) are unchanged context, shown so you can find your spot in the file.

To apply it: open your version of the file in Notepad (or any editor), find the surrounding context lines, then delete the `-` lines and add the `+` lines. Save.

{% hint style="info" %}
**Conflicts.** If you customized a value the update also touches (e.g. you set `CommandPostType = 9` and the update removes the line), keep your customization unless `NOTES.md` says the change is required. When in doubt, ask in Discord.
{% endhint %}

## 6. Run database migrations

If the bundle has a `migrations/` folder with `.sql` files, run them against the `muonline` database, oldest version first. Each file name starts with the version it belongs to, for example `v1.0.7_widen_memb_pwd_for_pbkdf2.sql`. If you skipped versions, run the files of every version you skipped, in version order.

In SSMS: connect to your SQL Server instance → **File → Open → File...** → pick the first `.sql` → make sure the dropdown at the top shows `muonline` → **Execute** (F5). Repeat for the next file.

{% hint style="warning" %}
Run each migration **once**. Running the same migration twice can fail or duplicate data. If a migration fails partway through, restore the database backup from step 3 and ask in Discord before retrying.
{% endhint %}

If there is no `migrations/` folder in the bundle, skip this step.

{% hint style="info" %}
This step is for 1.x bundles only. From 2.0.0, database changes are numbered files (`0001_*.sql`, `0002_*.sql`, ...) in the server package's `migrations\` folder. The Server Manager runs them for you and records each one in the `dbo.AxiomSchemaVersion` table. Do not run them by hand on a 2.x server that the Manager updates. The only time you run them by hand is the one-time upgrade below.
{% endhint %}

## 7. Start the servers

`ServerStartUP.exe` → **Run All**, or launch the four EXEs manually in this order:

```
DataServer  ->  JoinServer  ->  ConnectServer  ->  GameServer
```

Each console should print a line confirming it activated the new version. Watch for red error lines in the first 30 seconds — those are usually a config field that wasn't merged correctly in step 5.

## 8. Distribute the client update

If the bundle changed `Main.exe` (or anything else under `client/`), your players need it too. Drop the new client files into your patch folder so your launcher picks them up on the next run. Players who launch the game will auto-download the new files.

If you don't run a launcher, hand the new client files out the same way you distributed the original install.

## 9. Verify

Within about 30 minutes the customer portal dashboard updates to show all four servers running the new version. Once it does, click **Mark as Updated** on the update banner.

In-game, check anything called out in `NOTES.md` actually behaves as described.

## Upgrading a V1 database to V2 by hand

Version 2.0.0 is a fresh install. A **new** server uses the `MuOnline.bak` from the 2.0.0 package (`migrations\MuOnline.bak`) and needs none of this.

If you want to keep your 1.x database (accounts, characters, items) and run 2.0.0 on it, you must bring the database up to the V2 schema yourself, once. The Server Manager cannot do this part: it only updates databases that are already V2.

{% hint style="danger" %}
The 2.0.0 DataServer checks the database at startup. If the `dbo.AxiomSchemaVersion` table is missing, or its highest number is below `2`, the DataServer logs `[Schema] NOT STARTING` and does not accept GameServers. That is what you see if you start 2.0.0 on a 1.x database without the steps below.
{% endhint %}

Before you start:

1. Update the 1.x server to **1.0.7** with the normal steps on this page, including every 1.x migration.
2. Log every player out (GameServer menu **Close Server: 5 Minutes**, or **Logout All Users**), then stop all servers.
3. Back up the database (step 3 above). Some scripts below change or drop tables.

Then run these scripts in SSMS against the `muonline` database, **in this order**:

| #  | Script                                                      | What it does                                                                                                                                 |
| -- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| 1  | `dbo.TalentTree.Table.sql`                                  | Talent tree table. This file is saved as UTF-16; SSMS opens it fine. It has no `USE` line, so pick `muonline` in the database dropdown first |
| 2  | `dbo.DungeonProgress.Table.sql` (or `dungeon_progress.sql`) | Dungeon progress table                                                                                                                       |
| 3  | `dbo.AchievementProgress.Table.sql`                         | Achievement progress table                                                                                                                   |
| 4  | `dbo.ItemExt.Table.sql`                                     | Extra item data table (inscriptions)                                                                                                         |
| 5  | `dbo.PvPKillLog.Table.sql`                                  | PvP kill log table                                                                                                                           |
| 6  | `dbo.HelperLoot.Table.sql`                                  | MU Helper loot list table                                                                                                                    |
| 7  | `add_resetsystem_missing_columns.sql`                       | Adds missing columns to `ResetSystemSettings`                                                                                                |
| 8  | `add_luckyspin_missing_columns.sql`                         | Adds missing columns to `LuckySpin` and `LuckySpinPending`                                                                                   |
| 9  | `add_optiondata_changeskin.sql`                             | Adds the `ChangeSkin` column to `OptionData`                                                                                                 |
| 10 | `0001_axiom_schema_version.sql`                             | Creates `dbo.AxiomSchemaVersion` and records version 1                                                                                       |
| 11 | `0002_market.sql`                                           | Market tables and columns, records version 2. **Drops the old `PShopItemValue` table**                                                       |

Scripts 10 and 11 are in the 2.0.0 server package under `migrations\`. Scripts 1 to 9 are not in the server package; if you do not have them, ask in Discord.

{% hint style="warning" %}

* Run each script **once**. Scripts 1, 2 (`dbo.DungeonProgress.Table.sql`) and 3 fail with "There is already an object named ..." if the table exists. That error is harmless: the table is already there, move on. `dungeon_progress.sql` and scripts 4 to 11 check first and are safe to run again.
* Most scripts select the database with a `USE [muonline]` or `USE [MuOnline]` line. If your database has a different name, change that line before you run the script.
* Script 10 must run after scripts 1 to 9. Script 11 needs script 10.
  {% endhint %}

When script 11 finishes, `SELECT MAX(Id) FROM dbo.AxiomSchemaVersion` returns `2`. Install the 2.0.0 server package into a **new** folder, copy your configs over, and start the DataServer. It should start normally. From here, the [Server Manager](/docs/guides/updating-with-server-manager.md) handles every later database change.

## Rolling back

If the new version misbehaves and you can't fix it quickly:

1. Stop the servers (step 4).
2. Restore the install folder from the zip you made in step 3.
3. Restore the database backup:

```sql
USE master;
ALTER DATABASE [muonline] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
RESTORE DATABASE [muonline] FROM DISK = 'C:\AxiomBackups\muonline_pre_1.0.1.bak' WITH REPLACE;
ALTER DATABASE [muonline] SET MULTI_USER;
```

4. Start the servers.

Then report what went wrong in Discord with the relevant log excerpt.

## Troubleshooting

<details>

<summary>"Update available" banner still shows after I updated</summary>

One of the four servers wasn't restarted, or one of them is still on the old EXE. Check each console — the activation line on startup includes the version. If one is wrong, stop that server, copy the EXE again, and start it.

</details>

<details>

<summary>I overwrote a file before reading the diff and lost my customization</summary>

Restore that file from the install-folder zip you made in step 3, then re-apply the diff by hand.

</details>

<details>

<summary>The update folder has only some of the listed subfolders</summary>

Normal. Small updates often only contain `binaries/` and a couple of `changed/` files. Folders only appear when there's something inside them.

</details>

<details>

<summary>SQL migration fails with "object already exists" or similar</summary>

The migration was likely run before. Check what changed by opening the `.sql` and comparing to the database (e.g. does the new column already exist on the table?). If everything in the migration is already applied, you can skip that file. If only some of it ran, restore the DB backup and ask in Discord — running it a second time may corrupt data.

</details>
