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 Backup feature backs up BusinessObjects content, not the MMDB. For the embedded database, the PostgreSQL tools pg_dump, pg_restore and psql are installed in server\pgsql-win-16.3.2\bin\.
Before you begin¶
- Know the connection: for the embedded database, host
localhost, port49614, databasemetaminer, usermmuser. 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¶
- Open a command prompt on the MetaMiner Server.
-
Run
pg_dumpin custom format:
pg_dump takes a consistent snapshot while the server keeps running. For a quiet backup window, schedule it outside pull-heavy hours or use Do Not Disturb windows.
Restore¶
- In MMA, click Stop Server.
-
Recreate an empty database and restore into it:
Restore into the embedded MMDBcd /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= -
Start the server. MMS applies any database updates the restored copy is missing.
Restore replaces all metadata
Dropping the database deletes everything in it. Make sure the backup file is complete before you drop the database.
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_restoreends without errors.- After start, the MetaMiner Client shows the environments and their content.
- Data Integrity Status counts converge after the next pulls.