6.0 PostgreSQL—Backup and Restore from the Command Prompt

IMPORTANT:If you deploy the Micro Focus PostgreSQL appliance, use the phpPgAdmin web front end to back up the TeamWorks database.

A “Hot Backup” process for PostgreSQL is available from Oracle as part of the paid-for version of PostgreSQL.

Backing Up PostgreSQL from the Command Line

If you need to back up or restore the TeamWorks database from the command line, do the following:

  1. Shut down the PostgreSQL service.

  2. Run the following command:

    PostgreSQLdump -u root -p TeamWorks >/backupdir/TeamWorksback.sql

    This creates a file named TeamWorksback that can be used to restore the database.

  3. Restart PostgreSQL.

Restoring PostgreSQL from a Backup File

  1. (Optional) If a TeamWorks table does not exist in the location where you want to restore the TeamWorks database, you must create it as follows:

    1. Log in to PostgreSQL using the following command:

      PostgreSQL -p

    2. Create the database using the following command:

      create database TeamWorks;

  2. When a TeamWorks table exists on the location where you want to restore the database, do the following:

    1. Quit PostgreSQL

    2. Run the following command:

      PostgreSQL -p TeamWorks < /backupdir/TeamWorks-back.sql

    This completes the restore of the TeamWorks database and its associated tables.