Promocionar servidor
14 lines 6 KiB Markdown Source Rendered Raw Permalink History
---
title: "How to Back Up and Restore a Full CS 1.6 Server"
excerpt: "Exactly which files hold your CS 1.6 server's identity — configs, admins, bans, stats, plugins, maps — how to archive them, restore onto a new box, and verify nothing was lost."
category: "installation"
tags: "backup, migration"
image: ""
read_time: "8 min read"
---
<p>Everything that makes your server <em>yours</em> &mdash; your configs, admin list, bans, ranks, plugins and custom maps &mdash; is a handful of files. The multi-gigabyte HLDS install is replaceable; those files are not. A proper backup lets you rebuild on a new <a href="/tutorials/choose-vps-for-cs16">VPS</a> in minutes after a crash, a host failure, or a bad edit. This is exactly what to back up, how, and how to restore it without losing anything that matters.</p><h2>1. Know what is irreplaceable versus reinstallable</h2><p>Split your server into two buckets. <strong>Reinstallable</strong>: the base HLDS/ReHLDS engine and stock game files &mdash; you can re-download these any time with <a href="/tutorials/install-cs16-dedicated-server-linux-steamcmd">SteamCMD</a>. <strong>Irreplaceable</strong>: your configuration and accumulated state. Only the second bucket needs backing up, which keeps the archive small &mdash; typically a few megabytes rather than the multi-gigabyte engine tree. The irreplaceable files all live in a few known places under <code>cstrike/</code>, so a targeted backup is both smaller and faster to restore than imaging the whole install.</p><h2>2. The files that hold your server's identity</h2><ul><li><code>cstrike/server.cfg</code> and any config it execs &mdash; your cvars, hostname, rcon; see <a href="/tutorials/setup-server-cfg-cs16">server.cfg</a>.</li><li><code>cstrike/mapcycle.txt</code> and <code>cstrike/maps/</code> &mdash; your rotation and any custom <code>.bsp</code>/<code>.res</code> files.</li><li><code>cstrike/addons/amxmodx/configs/</code> &mdash; <code>users.ini</code> (admins), <code>plugins.ini</code>, <code>modules.ini</code>, <code>amxx.cfg</code>.</li><li><code>cstrike/addons/amxmodx/plugins/</code> &mdash; your compiled <code>.amxx</code> plugins.</li><li><code>cstrike/addons/amxmodx/data/</code> &mdash; ranks (<code>csstats.dat</code>) and any plugin vault/nvault data.</li><li>The engine ban files &mdash; <code>banned_user.cfg</code> and <code>listip.cfg</code> (names vary by build).</li></ul><p>These are the same paths covered in <a href="/tutorials/backup-configs-bans-stats">backing up configs, bans and stats</a>; here we archive the whole set for a full rebuild.</p><h2>3. Archive it in one command</h2><p>Stop or pause writes for a clean snapshot if you can (a running server rewrites <code>csstats.dat</code> and ban files), then tar the important trees with the date in the filename:</p><pre>cd /home/cs/hlds/cstrike
tar czf ~/csbackup_$(date +%F).tar.gz \
  server.cfg mapcycle.txt maps \
  addons/amxmodx/configs addons/amxmodx/plugins addons/amxmodx/data \
  banned_user.cfg listip.cfg</pre><p>Copy the resulting archive <strong>off the server</strong> &mdash; a backup that lives only on the box you are protecting against is not a backup. Pull it to your own machine or a separate host. Automate it with the same <a href="/tutorials/cron-restart-cs16-server">cron mechanism</a> used for restarts so a fresh archive is made daily.</p><h2>4. If you use MySQL, dump the database too</h2><p>SQL-backed ranks, bans or VIP live in a MySQL database, not in files, so the tar above misses them entirely. Dump the database separately:</p><pre>mysqldump -u csuser -p amxbans_db &gt; ~/csdb_$(date +%F).sql</pre><p>Store the <code>.sql</code> alongside the tarball. Restoring the files but forgetting the database is the classic "my bans and ranks are gone" mistake after a migration.</p><h2>5. Restore onto a fresh box</h2><p>On the new server: install the base engine and AMX Mod X first (<a href="/tutorials/install-cs16-dedicated-server-linux-steamcmd">SteamCMD</a> + <a href="/tutorials/install-amx-mod-x-1-9">AMX Mod X</a>) so the directory structure exists, then unpack your archive over it:</p><pre>cd /home/cs/hlds/cstrike
tar xzf ~/csbackup_2026-07-15.tar.gz</pre><p>Import the database dump if you have one (<code>mysql ... &lt; csdb_....sql</code>), then fix the two things that change on a new box: the server's IP/port in any config that hard-codes it, and file ownership so the game user can write to <code>data/</code> and the ban files. A restored server that cannot write <code>data/</code> loses every new rank and ban on the next map.</p><h2>Common errors</h2><ul><li><strong>Ranks/bans reset after restore</strong> &mdash; wrong ownership on <code>addons/amxmodx/data/</code> or the ban files, so the server cannot write them. Fix the directory ownership.</li><li><strong>SQL bans and ranks gone</strong> &mdash; you tarred the files but never dumped the MySQL database. Restore the <code>.sql</code> too.</li><li><strong>Plugins fail to load after restore</strong> &mdash; the new box is missing a module or the 32-bit libraries. See <a href="/tutorials/amxx-not-loading-install-checklist">the AMX Mod X not-loading checklist</a>.</li><li><strong>Server not visible after migration</strong> &mdash; a config hard-codes the old IP, or the firewall is closed. Update the IP and open <a href="/tutorials/cs16-server-firewall-ports">the ports</a>.</li><li><strong>Corrupt <code>csstats.dat</code></strong> &mdash; you archived it mid-write. Pause the server or stop it before the snapshot for a clean copy.</li></ul><h2>Verification</h2><p>Do a real restore test, not a hopeful one: unpack your backup into a fresh install on a spare box or locally, start it, and confirm the hostname, admin access (<code>amx_who</code> shows you with your flags), a known ban still present in <code>listid</code>, and your rank intact via <code>say /rank</code>. If all four survived, the backup is complete and your restore procedure works. Then check the archive actually exists off-site &mdash; open it from your own machine. A backup you have restored once is a backup you can trust when the box actually dies.</p>