Overview
This guide provides instructions for generating a PostgreSQL database dump for JetPatch when experiencing issues with the manager console.
The database dump can be created using three different methods and should be sent to the JetPatch support team for analysis.
Obtaining Database Details
Before generating the database dump, you need to obtain the database details (including DB name, username, and password) by accessing the backend of the JetPatch server.
- Run the following commands to get database information:
|
cd /usr/share/tomcat/default/conf/ cat intigua.properties | grep db |
Method 1: Using pg_dump Linux Utility
This method assumes you have root account access and uses the pg_dump Linux utility.
Standard JetPatch Configuration
Log into the database server using the default settings (user=jetpatch, port=5432, dbname=jetpatchdb):
| pg_dump -U jetpatch -h localhost -p 5432 jetpatchdb | gzip > db_dump.sql.gz |
| Note: Some deployments may have different settings (user=intigua, port=5432, dbname=intiguadb). |
| pg_dump -U intigua -h localhost -p 5432 intiguadb | gzip > db_dump.sql.gz |
Handling Authentication Issues
If you encounter authentication issues, start the command with the PGPASSWORD environment variable, using the password found in intigua.properties:
| PGPASSWORD="your_password_here" pg_dump -U jetpatch -h localhost -p 5432 jetpatchdb | gzip > db_dump.sql.gz |
File Location and Access
The dump file will be located in the same folder, or you can navigate to the PostgreSQL directory:
| cd /var/lib/postgresql |
or
| cd /var/lib/pgsql |
To transfer the file via SFTP, you may need to claim ownership of the directory:
| sudo chown -R $(whoami) /your/current/dir |
Alternative pg_dump Format
Alternatively, you can use the custom format (note: please share the exact PostgreSQL version if you use this method):
| pg_dump -Fc -U -h -p |
Handling Large Databases
For very large databases, you might need to split the dump file to prevent problems with file size limits on upload:
|
# Example 1 - split file after 1GB pg_dump dbname | split -b 1G - filename |
|
# Example 2 - split file after 1GB with custom format pg_dump -Fc dbname | split -b 1G - filename |
Method 2: Using pgAdmin
You can also create a database dump using pgAdmin.
Given a URL that looks like jdbc:postgresql://30.30.XX.XXX/stakeholder_temp, note that 30.30.XX.XXX is the database IP, and the last part ('stakeholder_temp') is the database name.
- Right-click and choose 'Create' → 'Server'.
- On the 'General' tab, name the connection whatever you like.
- On the 'Connection' tab: The hostname/address should contain the DB IP. Port: 5432.
- Obtain a username and password from an administrator or one of the backend developers.
- On the Advanced tab under 'DB Restriction', insert the database name ('stakeholder_temp').
- Press Save.
- Right-click on the newly created server and choose 'Connect Server'.
- Choose 'Databases'. Right-click on the database name and select 'Backup'.
- In the open dialog, give a name to the backup and press 'Backup'.
Method 3: Using DBeaver
You can create a database dump using DBeaver (community edition).
Prerequisites
- Install PostgreSQL
Steps
- Select 'File' → 'New' → 'Database connection' → 'Popular' → 'PostgreSQL'.
- Set 'Host' to the database IP, Port to 5432, and 'Database' to the database name.
- Press 'Finish'.
- Right-click on the database name and select 'Tools' → 'Backup'.
- Add a PostgreSQL client in the 'Client configuration'. Select 'Objects' → 'public'.
- Select 'Next' to check the output folder.
- Press 'Start'.
Comments
0 comments
Please sign in to leave a comment.