CUSTOS

Back up a database and test its recovery

A Windows client task can back up application files alongside logical dumps of MySQL, MariaDB or PostgreSQL. Test the set by restoring its SQL files into a separate folder and loading them into a test database server.

Add a local database server

  1. In the task editor, open Databases → Add → Find. Select the running server and check its address and port. OSPanel 6 modules can listen on addresses such as 127.127.126.x.
  2. Check the database program folder. It must contain the dump and connection tools for the chosen engine. Enter the database username and password.
  3. Choose Test connection. The service uses these credentials to list the databases. If the list is empty, check that the intended server instance is running and that the account can read the databases.
EngineClient programs on WindowsUsual port
MySQLmysqldump.exe, mysql.exe3306
MariaDBmariadb-dump.exe, mariadb.exe or the corresponding mysql tools on older versions3306
PostgreSQLpg_dump.exe, pg_dumpall.exe, psql.exe5432

Choose databases and inspect the first run

Choose All databases to pick up new user databases automatically. If the task only needs billing, leave it checked in Selected databases. Add the application’s file sources separately. Leave the live database data directory out of the sources.

Run the task and inspect the set. For MySQL, for example, db/mysql/billing.sql contains the database and db/mysql/_users.sql contains users and grants. Every run takes complete dumps of the selected databases, including incremental and differential file backups.

Recognize an incomplete dump

If the server is unreachable or a dump tool fails, CUSTOS marks the run as an error. The remaining files and databases continue to be copied. Older sets are retained, and the next run uses the last successful backup as its baseline.

Open the run log and find the database name and dump tool’s message. Restore access to the server and run the task again. When restored, an interrupted dump has the suffix .incomplete.sql and is flagged in the set’s instructions. Use a completed dump from a successful run for the recovery test.

Test recovery in a separate instance

  1. Select the set and restore into an empty folder. If you send ordinary files back to their original locations, specify a separate Database dumps to folder. CUSTOS extracts the SQL files and db/README.txt.
  2. Prepare a separate test server of the same engine. Use the commands in that set’s db/README.txt and verify the test server’s address. Run the Windows instructions in cmd. Restore the required users and grants, then create the test database and load its dump.
  3. Connect to the restored database. Check a known record or the row count in a familiar table and run an ordinary application query using a test account. This exercises the contents of the dump and the permissions the application needs.