Skip Ribbon Commands
Skip to main content
Navigate Up
Sign In

Quick Launch

Average Rating:

(1 Rating)
facebook Twitter
Email
Print Bookmark Alert me when this article is updated

Feedback

HOW TO: Take backup of PostgreSQL database and how to restore it in Axon
Solution
Starting from Axon Data Governance 5.3, there are slight changes, due to which steps to take a backup of database and to restore it are different than the steps for earlier versions. Thus, for latest versions of Axon (starting from v5.3), steps are as follows:

Steps To Take Backup Of PostgreSQL Database:

To back up the database, run the script file axon_db_backup.sh that contains the details of the backup. Perform the following tasks to backup the Axon database at the source location.

1. Go to <INSTALLATION_DIR>/scripts and run the following command to back up the database:
sh axon_db_backup.sh <BACKUP_DESTINATION_DIR>
2. Go to the backup destination directory to verify that the database backup file has been created. The database backup is an SQL file with the timestamp: 

<BACKUP_DESTINATION_DIR>/<backup_sql_file>
For example, your backup file might look like this: <BACKUP_DESTINATION_DIR>/postgres_2018_06_24_025744.sql

Steps To Restore the Backup Of PostgreSQL Database:

Perform the following tasks to restore the Axon database to the destination location:

1. Go to <INSTALLATION_DIR>/bin location where you have installed Axon and run the following command to shut down the Axon instance:
sh shutdown.sh

2. Go to <INSTALLATION_DIR>/axonhome/third-party-app/scripts, and run the following command to restart the PostgreSQL database service:
sh postgresql restart

3. Run the following command to define the Axon environment variable :
source <INSTALLATION_DIR>/scripts/exportEnv.sh 

4. Run the following command t o restore the database from the backup file:
<INSTALLATION_DIR>/axonhome/third-party-app/postgresql/bin/psql -U <Axon_Admininstrator> -d postgres -h localhost -f <BACKUP_DESTINATION_DIRECTORY>/<backup_sql_file>

For example, run the following command:

<INSTALLATION_DIR>/axonhome/third-party-app/postgresql/bin/psql -U axonuser -d postgres -h localhost -f <BACKUP_DESTINATION_DIR>/postgres_2018_06_24_025744.sql
Note that the user passed with -U parameter is the Axon non-root user that manages the Axon services. You can ignore any user or role error message that might be displayed.

5. Restart the Axon Services by running following command:
sh <INSTALLATION_DIR>/bin/startup.sh

6. Go to the <INSTALLATION_DIR>/scripts location and run the following script to re-index the database:

sh reIndex.sh
​​
More Information
​​This article also applies to Axon version  7.0 
Reference
Applies To
Product: Axon Data Governance
Problem Type: Configuration
User Type: Administrator; Developer
Project Phase: Onboard
Product Version: Axon 5.3; Axon 5.4; Axon 6.0; Axon 6.1; Axon 6.2; Axon 6.3
Database:
Operating System:
Other Software:
Attachments
Last Modified Date:7/6/2020 8:38 AMID:558784
People who viewed this also viewed

Feedback

Did this KB document help you?



What can we do to improve this information (2000 or fewer characters)