Skip to content

Updating & database

You never import schema by hand. bs_core has the migrations in bs_core/sql/ (001_core_schema.sql … 028_guard_log.sql), and the list in bs_core/server/sv_migrations.lua. On start it runs every file that isn’t in the bs_migrations table yet and records it. Applied ones never run again.

So an update that brings a new table is just: update the files, restart. The console prints which migration it applied.

Some resources (bs_config, bs_guard, bs_vip, bs_factions progression) also create their own tables on start if they are missing. That’s a safety net, the migration is still the real source.

Terminal window
powershell -ExecutionPolicy Bypass -File .\tools\Backup-Database.ps1 -Database beyondsurvival -User beyond

It asks for the password and writes a timestamped .sql into database-backups/. It uses --single-transaction, it doesn’t lock or change the live DB.

Do it every time. Migrations only go forward, there is no “down”.

  1. Stop the server.
  2. Backup (above).
  3. Replace the changed resources. Keep your edited config files, or diff them against the new ones. New keys in a config are usually needed by the new code.
  4. Don’t touch server.private.cfg. Check server.cfg.example for new ensure lines and add them to yours.
  5. Run tools\Test-Deployment.ps1.
  6. Start and watch the console for red lines.

Your F1 profiles live in the database, they survive updates. A profile key that doesn’t exist anymore is just ignored.

Never copy cache/ between machines or versions, delete it if something looks weird after an update.

The release package doesn’t contain the database on purpose. Back up on the old one, then on the new one create a new empty database and:

Terminal window
powershell -ExecutionPolicy Bypass -File .\tools\Import-Database.ps1 -Database beyondsurvival -User beyond -BackupFile D:\transfer\beyondsurvival-YYYYMMDD-HHMMSS.sql

It never drops a database and asks you to type IMPORT first. Keep the original backup until the new server has run fine for a while.

Treat that .sql file as private. It has every character, inventory, faction bank and identifier.

txadmin/recipe.yaml deploys the release plus a new empty database through txAdmin’s Server Deployer. It’s a new world, nothing from the old DB comes along. See txadmin/README.md for the zip layout.