Skip to content

Backing Up Your Database

Bryce Mecum edited this page Feb 11, 2024 · 22 revisions

Note

Backing up a database can be complicated and this guide is intended to serve as a recipe and not a guide.

In general, you should:

  1. Do your own research
  2. Not test any new methods on your users
  3. Test that your backups work before the day you actually need them

If you're using MySQL as your ACE server's database, there are two ways to back it up:

  1. Using MySQL Workbench. This is suitable for local testing and development but is not recommended if your ACE server is running and players are connected.
  2. Using mysqldump. This is suitable for any use case, including backing up while your ACE server is running and players are connected.

Using MySQL Workbench

  1. Open MySQL Workbench. If you don't already have it, you can get it from https://www.mysql.com/products/workbench/.

  2. Connect to your MySQL Server

  3. In the Server menu, select Data Export

    01
  4. In the "Administration - Data Export" pane that appears,

    • Under Tables to Export, select ace_auth, ace_shard, and ace_world.
    • Under Export Options, switch to "Export to Self-Contained File"
    • Check "Include Create Schema"
    • Click "Start Export"
    02
  5. You should see something like the following:

    03

Using mysqldump

The reason backing up your databases with mysqldump is preferred over MySQL Workbench for a running ACE server that has players connected is that mysqldump lets you set the --single-transaction flag on the command line whereas MySQL Workbench does not. This flag ensures you (1) get an internally consistent backup of your ACE server (2) don't cause your players to lag while the backup runs.

To back up your databases with --single-transaction, run,

.\mysqldump.exe -u root --single-transaction ace_shard > ace_shard.sql
.\mysqldump.exe -u root --single-transaction ace_auth > ace_auth.sql

Notes

  • Backing up ace_world isn't usually necessary but is if you made changes to the database directly (which is not recommended).
  • Depending on how you installed MySQL Server, mysqldump may be in a different location than shown below.