-
Notifications
You must be signed in to change notification settings - Fork 247
Backing Up Your Database
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:
- Do your own research
- Not test any new methods on your users
- 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:
- 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.
- Using mysqldump. This is suitable for any use case, including backing up while your ACE server is running and players are connected.
-
Open MySQL Workbench. If you don't already have it, you can get it from https://www.mysql.com/products/workbench/.
-
Connect to your MySQL Server
-
In the Server menu, select Data Export
-
In the "Administration - Data Export" pane that appears,
- Under Tables to Export, select
ace_auth
,ace_shard
, andace_world
. - Under Export Options, switch to "Export to Self-Contained File"
- Check "Include Create Schema"
- Click "Start Export"
- Under Tables to Export, select
-
You should see something like the following:
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
- 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.