Regular MU Server Maintenance: Backup, Updates and Routine
Learn how to set up automated backup routines, safely apply updates, and keep your MU Online private server stable and up to date.
Why Regular Maintenance is Critical
A MU Online private server accumulates data, logs and database fragmentation at a rapid pace. Without periodic maintenance, you will face progressive slowdowns, character data corruption and failures in events like Blood Castle and Devil Square. This guide covers the essential procedures every administrator needs to run on a weekly basis.
Part 1: Database Backup
Step 1 — Identify your server databases
Your MU server typically uses two main databases in SQL Server:
MuOnline— character data, accounts, items, guildsMeShop(orWebShop) — online shop, cash points, transactions
Open SQL Server Management Studio (SSMS) and connect to the local server (localhost or .\SQLEXPRESS).
Step 2 — Create a manual backup via T-SQL
Run the following in SSMS (Query → New Query):
-- Full backup of the MuOnline database
BACKUP DATABASE [MuOnline]
TO DISK = 'C:\Backups\MuOnline_Full_' +
CONVERT(VARCHAR, GETDATE(), 112) + '.bak'
WITH FORMAT, COMPRESSION, STATS = 10;
-- Full backup of the MeShop database
BACKUP DATABASE [MeShop]
TO DISK = 'C:\Backups\MeShop_Full_' +
CONVERT(VARCHAR, GETDATE(), 112) + '.bak'
WITH FORMAT, COMPRESSION, STATS = 10;
C:\Backups\ folder before running the script. The COMPRESSION parameter reduces file size by up to 70%, which is essential to keep disk usage under control.Step 3 — Automate with SQL Server Agent
- In SSMS, expand SQL Server Agent → Jobs → New Job
- Under General, name it:
Daily_Backup_MuOnline - Under Steps → New Step:
- Type:
Transact-SQL script (T-SQL) - Paste the script from Step 2
- Under Schedules → New Schedule:
- Frequency:
Daily - Time:
03:00:00(lowest traffic window)
- Click OK to save the job
.bat file calling sqlcmd instead.Step 4 — .bat script for backup via Task Scheduler (Express edition)
Create C:\Scripts\backup_mu.bat:
@echo off
SET HORA=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%
sqlcmd -S localhost\SQLEXPRESS -Q "BACKUP DATABASE [MuOnline] TO DISK='C:\Backups\MuOnline_%HORA%.bak' WITH FORMAT, COMPRESSION"
sqlcmd -S localhost\SQLEXPRESS -Q "BACKUP DATABASE [MeShop] TO DISK='C:\Backups\MeShop_%HORA%.bak' WITH FORMAT, COMPRESSION"
echo Backup completed on %DATE% %TIME% >> C:\Logs\backup_log.txt
In Task Scheduler: Create Task → Triggers → Daily → 03:00 → Actions → Start a program → point to C:\Scripts\backup_mu.bat.
Part 2: Server File Backup
Step 5 — Directory structure to preserve
Critical directories vary by version, but in standard Season 6 they are:
C:\MuServer\
├── GameServer\
│ ├── Data\ ← monster, map, and drop configurations
│ ├── GameServer.ini ← main configuration file
│ └── *.cfg ← event configuration files
├── ConnectServer\
│ └── ConnectServer.ini
├── DataServer\
│ └── DataServer.ini
└── EventServer\
└── EventServer.cfg
Step 6 — File backup script
Create C:\Scripts\backup_files.bat:
@echo off
SET DEST=C:\Backups\Files\%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%
mkdir "%DEST%"
xcopy "C:\MuServer\GameServer\Data\" "%DEST%\GameServer\Data\" /E /Y /Q
xcopy "C:\MuServer\GameServer\*.ini" "%DEST%\GameServer\" /Y /Q
xcopy "C:\MuServer\GameServer\*.cfg" "%DEST%\GameServer\" /Y /Q
xcopy "C:\MuServer\ConnectServer\" "%DEST%\ConnectServer\" /E /Y /Q
xcopy "C:\MuServer\DataServer\" "%DEST%\DataServer\" /E /Y /Q
echo File backup: %DATE% %TIME% >> C:\Logs\backup_log.txt
Part 3: Database Cleanup and Optimization
Step 7 — Remove logs and inactive characters
Accumulated logs slow down queries and bloat the database. Run monthly:
-- Remove connection logs older than 90 days
DELETE FROM MuOnline.dbo.T_Log_Connectinfo
WHERE ConnectDate < DATEADD(DAY, -90, GETDATE());
-- Remove chat logs older than 30 days
DELETE FROM MuOnline.dbo.T_Log_Chat
WHERE LogDate < DATEADD(DAY, -30, GETDATE());
-- Remove accounts that never logged in after 180 days from registration
DELETE FROM MuOnline.dbo.MEMB_INFO
WHERE mail_chek = '0'
AND memb_joindate < DATEADD(DAY, -180, GETDATE());
SELECT COUNT(*) with the same WHERE clause before the DELETE to confirm how many records will be removed.Step 8 — Rebuild fragmented indexes
-- Check index fragmentation
SELECT
OBJECT_NAME(ips.object_id) AS TableName,
i.name AS IndexName,
ips.avg_fragmentation_in_percent
FROM sys.dm_db_index_physical_stats(DB_ID('MuOnline'), NULL, NULL, NULL, 'LIMITED') ips
JOIN sys.indexes i ON ips.object_id = i.object_id AND ips.index_id = i.index_id
WHERE ips.avg_fragmentation_in_percent > 30
ORDER BY ips.avg_fragmentation_in_percent DESC;
-- Rebuild all indexes in the MuOnline database
USE MuOnline;
EXEC sp_MSforeachtable 'ALTER INDEX ALL ON ? REBUILD WITH (ONLINE = OFF)';
Step 9 — Shrink the transaction log
USE MuOnline;
-- Truncate the transaction log
BACKUP LOG [MuOnline] TO DISK = 'NUL';
DBCC SHRINKFILE (MuOnline_log, 1);
Part 4: Applying Server Updates
Step 10 — Safe file update procedure
Never replace files while the server is online. Follow this sequence:
- Announce maintenance on your website/Discord 30 minutes in advance
- Save the current state: run
CHECKPOINTin SSMS - Stop services in the correct order:
- Close
GameServer.exe - Close
EventServer.exe - Close
DataServer.exe - Close
ConnectServer.exe
- Back up the files that will be replaced (Step 6)
- Apply the new files
- Start services in reverse order: ConnectServer → DataServer → EventServer → GameServer
Step 11 — Applying SQL update scripts
When an update includes database changes (new tables, columns or data):
-- Always use a transaction so you can roll back on error
BEGIN TRANSACTION;
-- Example: add a column for a new system
ALTER TABLE MuOnline.dbo.Character
ADD NewSystemPoints INT NOT NULL DEFAULT 0;
-- Example: insert new items into the base item table
INSERT INTO MuOnline.dbo.Item_serial (Item_index, Item_name, Item_level)
VALUES (512, 'New Item', 0);
-- If everything went well, commit
COMMIT TRANSACTION;
-- If there was an error, roll back with:
-- ROLLBACK TRANSACTION;
Step 12 — Verify configuration files after an update
After an update, review .ini and .cfg files for new parameters that may have been added. Compare the new file to your backup:
fc "C:\Backups\GameServer_previous\GameServer.ini" "C:\MuServer\GameServer\GameServer.ini" > C:\Logs\diff_ini.txt
Part 5: Weekly Maintenance Routine
Recommended weekly checklist
Monday:
[x] Review GameServer error logs (GameServer\Log\)
[x] Check available disk space (minimum 20% free)
[x] Confirm that automated backups ran successfully
Wednesday:
[x] Verify connectivity: ConnectServer responding on port 44405
[x] Check T_Log_Hack table for exploit attempts
[x] Monitor GameServer.exe memory usage
Friday:
[x] Full manual backup before the weekend
[x] Verify scheduled events (Blood Castle, Devil Square)
[x] Test backup restore in a separate environment (monthly)
Step 13 — Monitor automated events
Verify that event schedules are correct in GameServer\Data\Events\ or via the database:
-- Check Blood Castle event schedule configuration
SELECT * FROM MuOnline.dbo.EventSchedule
WHERE EventName LIKE 'BloodCastle%'
ORDER BY EventTime;
-- Reset a stuck Blood Castle counter
UPDATE MuOnline.dbo.EventSchedule
SET EventStatus = 0, CurrentCount = 0
WHERE EventName = 'BloodCastle';
GameServer\Data\Events\BloodCastle.ini with times in HH:MM format. Refer to the documentation for your specific server version.Common Troubleshooting
GameServer does not start after an update: Check GameServer\Log\Error.log. The most common cause is a DLL version mismatch. Restore the DLLs from your previous backup.
Database growing rapidly: Run EXEC sp_spaceused on each table to find the largest one. In most cases, T_Log_Connectinfo and T_Log_Chat are the culprits — apply the DELETE from Step 7.
ConnectServer not accepting connections: Verify that port 44405 is open in Windows Firewall and your router. Use netstat -an | findstr 44405 to confirm it is listening.
Characters disappearing after restart: This indicates that GameServer is shutting down without saving. Add a wait period before shutdown: use the forced save command in the GameServer console before closing the process.
Perguntas frequentes
How often should I back up the database?
Aim for daily incremental backups and a full weekly backup. For active servers, consider running backups every 6 hours using SQL Server Agent Jobs or a scheduled .bat script via Windows Task Scheduler.
Can I apply file updates while the server is online?
Never replace GameServer/ files while the server is running. Always stop all services (GameServer, ConnectServer, DataServer, EventServer) before replacing any executable or .ini configuration file.
What should I do if the database becomes corrupt after a SQL update?
Run DBCC CHECKDB('MuOnline') in SQL Server Management Studio to check integrity. If errors are found, restore the most recent backup and re-apply the SQL script line by line to identify the problematic command.
How do I check if GameServer is consuming too much memory?
In Task Manager (Ctrl+Shift+Esc), monitor the GameServer.exe process. Consumption above 2 GB on a Season 6 server with fewer than 200 players indicates a memory leak. Schedule an automatic restart via Task Scheduler at 04:00 as a preventive measure.