Backup and Restore
A full backup is three things. With all three you can rebuild the server.
What to back up
| What | Contents |
|---|---|
| The database | Users, roles and permissions, services, game and Docker configurations, settings. |
| The TCAdmin folder | Default C:\Program Files\TCAdmin3 (Windows) or /opt/tcadmin3 (Linux). Holds the configuration, the Master Encryption Key, licenses and the web certificate. |
| The game-server files | Default C:\TCAFiles (Windows) or /usr/local/tcadmin-files (Linux), or the folders you set under Settings → Servers → (your server). |
Passwords and other secrets in the database are encrypted with that key, which lives in the TCAdmin folder. Keep the folder and database backups together, plus the separate copy of the key you saved at install time. See Back Up Your Encryption Key.
Create a backup
- Back up the database. On the master, as Administrator or with
sudo, runtca backup --keep 1. The backup is saved as a.sqlfile in the TCAdmin folder'sdata/backups, and--keep 1deletes the older ones. - Archive the TCAdmin folder. On Windows, in PowerShell as Administrator:
tar.exe -a -cf C:\tcadmin3-backup.zip -C "C:\Program Files" TCAdmin3. On Linux:sudo tar -czpf tcadmin3-backup.tar.gz -C /opt tcadmin3. Both work while TCAdmin is running. - Copy the game-server files folder.
- Store the copies on another machine or off-site, never only on the same server. Schedule the steps nightly; game servers keep running during a backup.
tca backup covers TCAdmin's own database only. Back up databases your customers create through the Databases feature with your usual MySQL tools.
The archive holds everything in data/backups, so keep that folder small.
- Old database backups. Every
tca backuprun adds a file, and--keep 1leaves only the newest. - Game service backups. A server with an empty Backup path stores its service backups in
data/backupstoo, each service in a numbered folder. Set a Backup path outside the TCAdmin folder under Settings → Servers → (your server), then move the numbered folders there.
Restore onto a new server
Use the same operating system and IP address as before, so game addresses keep working.
With the quick install script (recommended)
For a fresh Windows or Ubuntu server.
- Copy the TCAdmin folder archive (
tcadmin3-backup.ziportcadmin3-backup.tar.gz) to the new server. - Run the quick install command with the folder added:
- Windows
- Ubuntu
In PowerShell as Administrator:
& ([scriptblock]::Create((irm "https://v3.tcafiles.com/windows-quick-install.ps1"))) -RestoreFrom "C:\tcadmin3-backup.zip"
As root:
apt update && apt install -y curl && bash <(curl -fsSL https://v3.tcafiles.com/ubuntu-quick-install.sh) --restore-from /root/tcadmin3-backup.tar.gz
The script uses the newest .sql in the archive's data/backups. To name another file, add -RestoreDatabase <file.sql> or --restore-database <file.sql>. A folder holding the unpacked archive works in place of the archive.
3. Copy the game-server files back to their old path.
4. Sign in with your existing account, open each game service, click Repair (next to Reinstall), then start it.
5. If you have remote servers, open Settings → Servers and click Restart All Monitors. The restore sets a new database password, and a remote server only picks it up when its monitor restarts. Its game servers keep running.
The script installs MariaDB and the required runtimes, imports the backup into a new database, puts the TCAdmin folder in place with its key, license and certificates, starts the services, and sets up the MySQL Manager account again. The new passwords are in the summary file (C:\ProgramData\TCAdminQuickInstall\summary.txt on Windows, /root/tcadmin-quick-install.txt on Ubuntu).
Limits:
- Master server only.
- Same operating system as the backup.
- TCAdmin stays at the backup's version. Update it from the panel afterwards.
- A backup with non-default panel ports restores this way on Windows only. On Ubuntu, restore it manually.
Manually
For servers the script doesn't fit, such as one with your own database server or another Linux distribution.
-
Install the software listed in System Requirements: MariaDB or MySQL and, on Windows, the Visual C++ runtimes.
-
Recreate the database and user with the same names as before, then load the backup in the MySQL/MariaDB command-line client:
CREATE DATABASE tcadmin3;CREATE USER 'tcadmin3'@'localhost' IDENTIFIED BY 'YourPassword';GRANT ALL PRIVILEGES ON tcadmin3.* TO 'tcadmin3'@'localhost';USE tcadmin3;SOURCE C:/Backups/tcadmin3.sql;If you have remote servers, let them reach the database again.
-
Put the TCAdmin folder and the game-server files back at the same paths as before. To unpack the archive on Windows:
tar.exe -xf C:\tcadmin3-backup.zip -C "C:\Program Files". On Linux:sudo tar -xzpf tcadmin3-backup.tar.gz -C /opt, which keeps the folder owned by root, as it must be. If the database user now has a different password, openconfig/appsettings.global.jsonin the TCAdmin folder and replace thePasswordvalue in theDatabasesection with the new password in plain text. TCAdmin encrypts it at start. If you have remote servers, also set it under Settings → Global Server Configuration → Database password, which is what remote servers receive. -
Register and start the TCAdmin services:
- Windows
- Linux
Run in PowerShell as Administrator:
& "C:\Program Files\TCAdmin3\cli\tca.exe" install-services
& "C:\Program Files\TCAdmin3\cli\tca.exe" add-to-path
Start-Service TCA3Monitor, TCA3Web
sudo /opt/tcadmin3/cli/tca install-services
sudo /opt/tcadmin3/cli/tca add-to-path
sudo systemctl start tca3monitor tca3web
Don't run the installer again. If tca only updates itself and exits, run the command again.
- Log in with your usual account and check your servers and services.
- Open each game service, click Repair on its page (next to Reinstall), then start it. Game servers won't start until you do.
After restoring
- Reinstall Docker, Wine or WSL if the old server used them, and re-enable Windows Auto-Logon.
- The quick install script sets the MySQL Manager account up again. After a manual restore, recreate the account in MariaDB and enter its password under the server's MySQL Manager settings. Customer databases are not part of the backup.
- After a manual restore that kept the database password, remote servers reconnect by themselves when the master is back on the same address. If the password changed, or one stays offline, click Restart All Monitors under Settings → Servers or restart its TCAdmin Monitor service.
- If the panel reports a license problem after a move to new hardware or a new IP, contact TCAdmin support.
- If a service doesn't start, see Console Mode.
Remote servers
A remote server has no database. Back up its TCAdmin folder and game-server files, restore them to the same paths, and run steps 4 and 6 of the manual restore.
Docker installation
Everything lives in the two volumes plus the game-files folder. Stop the container and back up all three. To restore, put them back and start it with the same docker run command. See Volumes.