Skip to content

Back Up and Restore MMDB

Back up the MetaMiner Database (MMDB) with the standard PostgreSQL tools, and restore it after a failure or onto a new server.

MetaMiner has no built-in MMDB backup. The MetaMiner Client Backups feature backs up Power BI and Fabric content to archive files, not the MMDB; see Backup and Restore. For the embedded database, the PostgreSQL tools pg_dump, pg_restore and psql are installed in server\pgsql-win-16.3.2\bin\.

Why back up the MMDB

Microsoft keeps activity events for about 30 days. The MMDB keeps them much longer (see Data Retention). A lost MMDB cannot be rebuilt from Microsoft for older activity and capacity history.

Before you begin

  • Know the connection: for the embedded database, host localhost, port 49614, database metaminer, user mmuser. For an external database, ask your DBA.
  • The password of that user.
  • Enough free disk space for the backup file. A compressed dump is usually much smaller than the data folder.

Back up the configuration too

An MMDB backup is useful only with the matching configuration. Also copy server\config\, server\security\, server\licenses\ and server\MetaMinerServer.properties. See Moving to a New Server.

Steps

Back up

  1. Open a command prompt on the MetaMiner Server.
  2. Run pg_dump in custom format:

    Back up the embedded MMDB
    cd /d "C:\Program Files\Infolytik\MetaMiner\server\pgsql-win-16.3.2\bin"
    set PGPASSWORD=<password>
    pg_dump -h localhost -p 49614 -U mmuser -d metaminer -F c -f D:\backup\mmdb-YYYYMMDD.dump
    set PGPASSWORD=
    

pg_dump takes a consistent snapshot while the server keeps running and collecting.

Restore

  1. In MMA, click Stop Server.
  2. Recreate an empty database and restore into it:

    Restore into the embedded MMDB
    cd /d "C:\Program Files\Infolytik\MetaMiner\server\pgsql-win-16.3.2\bin"
    set PGPASSWORD=<password>
    psql -h localhost -p 49614 -U mmuser -d postgres -c "DROP DATABASE metaminer;"
    psql -h localhost -p 49614 -U mmuser -d postgres -c "CREATE DATABASE metaminer OWNER mmuser TEMPLATE template0;"
    pg_restore -h localhost -p 49614 -U mmuser -d metaminer D:\backup\mmdb-YYYYMMDD.dump
    set PGPASSWORD=
    
  3. Start the server. MMS applies any database updates the restored copy is missing, and the collectors resume from the progress stored in the restored copy.

Restore replaces all metadata

Dropping the database deletes everything in it. Make sure the backup file is complete before you drop the database.

Restore onto PostgreSQL 16 or newer

Restore a database that holds Power BI data only into PostgreSQL 16 or newer.

TODO: validate these commands on a release build

Confirm that mmuser can drop and create the database on the embedded instance, and that pg_restore reports no ownership errors for the read-only and MetaQuery roles. Add the expected warnings, if any.

Verify

  • pg_restore ends without errors.
  • After start, the MetaMiner Client shows the tenants and their content.
  • Collection Status shows the environments becoming current again.

Next steps