How to Do Automatic Cloud Backup of MU Server
Learn to automate MU Online S6 server backups to the cloud using scripts, scheduling, and data security best practices.
Why Automate Your MU Online Server Backup
Running an MU Online Season 6 server involves a complex data ecosystem: the SQL Server database holding accounts, characters, inventories, quest progress, Castle Siege records, guild data, and zen transactions. Losing that database — whether through hardware failure, corruption, or human error — means losing every piece of server history.
Backup automation solves the primary problem administrators face: discipline. Manual backups work as long as you remember. An automated system works as long as the server is running. The difference between the two can determine whether your project survives.
In this tutorial you will set up a complete automatic backup flow: file generation, compression, upload to cloud storage, and rotation of old files.
Understanding What Needs to Be Backed Up
Before automating anything, it is essential to know what to back up. A typical MU S6 server has two categories of critical data.
SQL Server Database
The core of the server. The MuOnline database (or whatever name you configured) contains:
- Table
Character— all characters including class (Dark Knight, Dark Wizard, Fairy Elf, Magic Gladiator, Dark Lord, Summoner), level, stats (STR, AGI, VIT, ENE, CMD for Dark Lord), reset count - Table
AccountCharacter— link between accounts and characters - Table
Inventory— equipped and stored items for each character - Tables
GuildandGuildMember— complete guild structure - Event tables — Castle Siege, Crywolf Fortress, Blood Castle, Devil Square records
- Table
MuCash/ VIP — if the server has a points or VIP system
GameServer Configuration Files
These files are not in the database and are frequently forgotten:
GameServer\
└── Data\
├── Monster\ → custom spots and drops per map
├── MapServerInfo.txt → map settings (Lorencia, Noria, Devias, Dungeon,
│ Lost Tower, Atlans, Tarkan, Icarus, Aida, Karutan,
│ Kanturu, Kalima, Land of Trials, Crywolf Fortress,
│ Raklion, Vulcanus, Acheron)
├── Item\ → custom item drops and attributes
└── *.ini / *.xml → general server configuration files
.txt files — not in the SQL database. A SQL-only backup will not recover those configurations.Setting Up Automatic SQL Server Backup
Step 1 — Create the T-SQL Backup Script
Open SQL Server Management Studio (SSMS) and create a backup procedure. This script uses native compression and saves to a local folder before uploading to the cloud.
-- Procedure: sp_BackupMuOnline
-- Creates a compressed backup with a timestamp in the filename
USE master;
GO
CREATE PROCEDURE sp_BackupMuOnline
@BackupPath NVARCHAR(500) = 'D:\Backups\MuOnline\'
AS
BEGIN
DECLARE @FileName NVARCHAR(600)
DECLARE @DateStamp NVARCHAR(20)
DECLARE @FullPath NVARCHAR(700)
-- Format: MuOnline_20240115_0300.bak
SET @DateStamp = CONVERT(NVARCHAR(8), GETDATE(), 112)
+ '_'
+ REPLACE(CONVERT(NVARCHAR(5), GETDATE(), 108), ':', '')
SET @FileName = 'MuOnline_' + @DateStamp + '.bak'
SET @FullPath = @BackupPath + @FileName
BACKUP DATABASE [MuOnline]
TO DISK = @FullPath
WITH
COMPRESSION, -- reduces size by up to 80%
CHECKSUM, -- validates integrity during backup
FORMAT,
STATS = 10, -- progress every 10%
NAME = N'Automatic backup ViciadosMU';
-- Logs the backup to the tracking table
INSERT INTO MuOnline.dbo.BackupLog (DateTime, FileName, Status)
VALUES (GETDATE(), @FileName, 'OK');
PRINT 'Backup completed: ' + @FullPath;
END;
GO
BackupLog table inside the MuOnline database to maintain a history of when each backup ran. If the server ever hangs at backup time, you will know exactly which was the last successful one.Step 2 — Schedule via SQL Server Agent
In SSMS, expand SQL Server Agent → Jobs → New Job. Configure:
- Name:
Backup_Automatico_MuOnline - Step 1: T-SQL, executes
EXEC sp_BackupMuOnline - Schedule: Daily at 03:00 (lowest player traffic)
For incremental backups every 6 hours, create a second schedule running every 6 hours for a transaction log backup (Full recovery mode required).
Uploading to the Cloud with PowerShell
With the .bak file saved locally, the next step is to automatically send it to cloud storage. Native Windows PowerShell integrates with the main options without requiring additional software.
Using rclone for Multiple Providers
rclone is a free, open-source command-line tool that connects to Google Drive, Mega, Dropbox, OneDrive, S3-compatible services, and dozens of others. It is the most versatile choice for MU servers.
# Script: BackupMuCloud.ps1
# Runs SQL backup and uploads to cloud via rclone
param(
[string]$BackupDir = "D:\Backups\MuOnline\",
[string]$RcloneDest = "gdrive:Backups/MuOnline/", # adjust to your remote
[int]$RetentionDays = 7 # deletes local backups older than 7 days
)
$LogFile = "D:\Backups\Logs\backup_$(Get-Date -Format 'yyyyMM').log"
function Write-Log {
param([string]$Msg)
$line = "[$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')] $Msg"
Write-Host $line
Add-Content -Path $LogFile -Value $line
}
Write-Log "=== Starting automatic MuOnline backup ==="
# 1 → Run backup on SQL Server
Write-Log "Generating database backup..."
$SqlResult = sqlcmd -S localhost -Q "EXEC sp_BackupMuOnline" -b
if ($LASTEXITCODE -ne 0) {
Write-Log "ERROR: SQL backup failed. Code: $LASTEXITCODE"
exit 1
}
Write-Log "SQL backup completed successfully."
# 2 → Identify the most recent file
$File = Get-ChildItem -Path $BackupDir -Filter "*.bak" |
Sort-Object LastWriteTime -Descending |
Select-Object -First 1
if (-not $File) {
Write-Log "ERROR: No .bak file found in $BackupDir"
exit 1
}
Write-Log "File to upload: $($File.Name) ($([math]::Round($File.Length/1MB,2)) MB)"
# 3 → Upload to cloud with rclone
Write-Log "Uploading to cloud: $RcloneDest"
& rclone copy $File.FullName $RcloneDest --progress --log-level INFO
if ($LASTEXITCODE -ne 0) {
Write-Log "ERROR: Upload failed. Check rclone configuration."
exit 1
}
Write-Log "Upload completed successfully."
# 4 → Remove old local backups (rotation)
Write-Log "Removing local backups older than $RetentionDays days..."
$Cutoff = (Get-Date).AddDays(-$RetentionDays)
$OldFiles = Get-ChildItem -Path $BackupDir -Filter "*.bak" |
Where-Object { $_.LastWriteTime -lt $Cutoff }
foreach ($f in $OldFiles) {
Remove-Item $f.FullName -Force
Write-Log "Removed: $($f.Name)"
}
Write-Log "Rotation complete. Backups removed: $($OldFiles.Count)"
Write-Log "=== Backup finished successfully ==="
Configuring rclone
After installing rclone, run rclone config and follow the wizard to set up your provider. For Google Drive:
rclone config
→ n (new remote)
→ Name: gdrive
→ Type: drive (Google Drive)
→ Follow the OAuth authentication flow in your browser
→ Confirm the settings
To test: rclone lsd gdrive: should list the folders in your Google Drive.
Scheduling the Script in Windows Task Scheduler
With the PowerShell script ready, schedule it to run automatically:
- Open Task Scheduler (
taskschd.msc) - Click Create Basic Task
- Configure:
- Name:
BackupMuOnlineCloud - Trigger: Daily at 03:30 (30 minutes after the SQL backup)
- Action: Start a program
- Program:
powershell.exe - Arguments:
-NonInteractive -ExecutionPolicy Bypass -File "D:\Scripts\BackupMuCloud.ps1"
- Under Conditions, uncheck "Start the task only if the computer is on AC power" (VPS runs 24/7)
- Under Settings, check "Run task as soon as possible after a scheduled start is missed"
svc_backup user with access only to the required folders.Retention Strategy and Cloud Organization
Keeping all backups forever wastes storage and makes it harder to find the right file during an emergency. Use a tiered strategy:
gdrive:Backups/MuOnline/
├── daily/ → last 7 days (replaced by the script's rotation)
├── weekly/ → 1 backup per week, retained for 4 weeks
└── monthly/ → 1 backup per month, retained for 6 months
To automatically populate the weekly and monthly folders, add to the PowerShell script:
# At the end of the script, after successful upload:
# Weekly backup (every Monday)
if ((Get-Date).DayOfWeek -eq 'Monday') {
& rclone copy $File.FullName "gdrive:Backups/MuOnline/weekly/" --progress
Write-Log "Weekly backup uploaded."
}
# Monthly backup (every 1st of the month)
if ((Get-Date).Day -eq 1) {
& rclone copy $File.FullName "gdrive:Backups/MuOnline/monthly/" --progress
Write-Log "Monthly backup uploaded."
}
Testing the Restore
A backup that has never been tested may be useless. Set aside time once a month to test restoration:
-- Restores the database in a test environment (NEVER on the production server)
-- First, take the target database offline or use a different name
RESTORE DATABASE [MuOnline_Test]
FROM DISK = 'D:\Backups\MuOnline\MuOnline_20240115_0300.bak'
WITH
MOVE 'MuOnline' TO 'D:\TestDB\MuOnline_Test.mdf',
MOVE 'MuOnline_log' TO 'D:\TestDB\MuOnline_Test_log.ldf',
REPLACE,
STATS = 10;
-- Validates integrity without restoring (faster for routine verification)
RESTORE VERIFYONLY
FROM DISK = 'D:\Backups\MuOnline\MuOnline_20240115_0300.bak'
WITH CHECKSUM;
RESTORE DATABASE pointing to the production database while the MU server is running. This will crash the GameServer and corrupt data. Always use a database with a different name (e.g. MuOnline_Test) for restore tests.Monitoring and Alerts
Set up email alerts to know when a backup fails:
# Add to the end of the script, in the error handling block:
function Send-AlertEmail {
param([string]$Subject, [string]$Body)
$SmtpServer = "smtp.gmail.com"
$Port = 587
$From = "[email protected]"
$To = "[email protected]"
$Credential = New-Object PSCredential(
$From,
(ConvertTo-SecureString "YOUR_APP_PASSWORD" -AsPlainText -Force)
)
Send-MailMessage `
-SmtpServer $SmtpServer `
-Port $Port `
-UseSsl `
-Credential $Credential `
-From $From `
-To $To `
-Subject $Subject `
-Body $Body `
-Encoding UTF8
}
# Call the function on error:
# Send-AlertEmail "ERROR MuOnline Backup" "Backup failed at $(Get-Date). Check the log: $LogFile"
With this complete system you will have: automatic SQL backup at 3:00 AM, cloud upload at 3:30 AM, local file rotation, tiered retention in the cloud, and email alerts on failure. Your character data, accounts, inventories, and server configurations will be protected even in critical hardware failure scenarios.
Perguntas frequentes
How often should I back up the server?
For active servers, run full daily backups and incremental backups every 4-6 hours. The MU database stores characters, accounts, inventories, and quest progress — losing 6 hours of data is already enough to frustrate players and damage the server's reputation.
Does automatic backup impact server performance during the process?
It depends on the method. A direct SQL Server BACKUP DATABASE command generates heavy disk I/O. To minimize the impact, schedule backups during the lowest-traffic hours (early morning), use compression (WITH COMPRESSION), and if possible write the backup to a separate physical disk before uploading to the cloud.
Which server files do I need to include in the backup besides the database?
Beyond the SQL database, include the GameServer Data\\ folders (monster configurations, spots, drops, Castle Siege), the ConnectServer and JoinServer .ini and .xml files, the WebEngine or web panel configuration files, and any custom event or NPC scripts you have edited.
How do I verify that the backup sent to the cloud is intact?
Whenever possible, run a monthly restore test in a separate environment. For quick verification, compare the backup file size against the expected size, and for SQL backups with CHECKSUM, use RESTORE VERIFYONLY to validate integrity without performing a full restore.
What is the average size of an MU S6 server database?
It varies greatly with server age and number of accounts. A new server with a few hundred accounts occupies between 500 MB and 2 GB. Older servers with thousands of accounts and extensive logs can reach 10-20 GB. Monitor growth to correctly dimension cloud storage.