Skip to main content

Backups

Critical: It is essential to make regular backups and to test the backups.

What to Back Up

1

Database backups

Most persistent data are stored in the PostgreSQL database. The database should be backed up often using standard PostgreSQL backup tools:
pg_dump -h hostname -p port -U user metadb > metadb_backup.sql
Or for compressed backups:
pg_dump -h hostname -p port -U user -Fc metadb > metadb_backup.dump
2

Configuration file

The metadb.conf file in the data directory should be backed up:
cp data/metadb.conf metadb.conf.backup
3

Data directory (optional)

The data directory contains the configuration file and is used for temporary storage. While the temporary files don’t need backing up, it’s good practice to back up the entire directory structure.

Backup Best Practices

  • Schedule automated database backups at regular intervals
  • Store backups in a separate location from the primary server
  • Test backup restoration procedures periodically
  • Maintain multiple backup versions

Upgrading from a Previous Version

1

Stop the server

If the server is running, stop it first:
metadb stop -D data
2

Run the upgrade process

Run the upgrade process before starting the new version:
metadb upgrade -D data
The upgrade process may, in some instances, take a significant amount of time to run. The database generally remains available to users during this period.
3

Check the output

If no changes are needed, the process outputs:
metadb: "data" is up to date
If changes were required, the process will show progress and completion messages.
4

Start the server

After the upgrade completes successfully, start the server:
nohup metadb start -D data -l metadb.log &

Upgrade Notes

Yes, you can upgrade from any previous version of Metadb. The upgrade command handles all necessary database migrations automatically.
The upgrade process:
  • Checks the current database schema version
  • Applies any necessary schema migrations
  • Updates internal metadata structures
  • Verifies data integrity
The database remains available for read operations during most upgrade operations.
If the upgrade process encounters an error:
  1. Do not start the server
  2. Check the error messages in the output
  3. Restore from your backup if necessary
  4. Contact Metadb support with the error details

Version Management

To check the current Metadb version:
metadb version
This displays the installed version number, which is helpful when planning upgrades or reporting issues.

Build docs developers (and LLMs) love