-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrading PostgreSQL for ReportPortal
- Loading branch information
Yuliya_Prihodko
authored and
Yuliya_Prihodko
committed
Oct 9, 2024
1 parent
2c46fc3
commit 571bb28
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
docs/installation-steps-advanced/UpgradingPostgreSQLForReportPortal.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Upgrading PostgreSQL for ReportPortal | ||
|
||
:::important | ||
This guide is intended for users planning to upgrade from Postgres 12 to a newer version, starting with ReportPortal version 24.2. | ||
::: | ||
|
||
This guide will walk you through backing up your current PostgreSQL database, removing existing containers and volumes, downloading the latest release, and restoring the PostgreSQL dump. | ||
|
||
## Step 0: Backup Postgres and Storage | ||
Before proceeding, ensure you have a complete Postgres database and Storage backup. | ||
|
||
## Step 1: Create a Dump of Database | ||
Run the following command to create a dump of your current PostgreSQL database: | ||
|
||
```bash | ||
docker exec -t postgres pg_dump -U rpuser -d reportportal > reportportal24_1_postgres12_dump.sql | ||
``` | ||
|
||
## Step 2: Remove All Containers | ||
Shut down and remove all containers: | ||
|
||
```bash | ||
docker compose -p reportportal down | ||
``` | ||
|
||
## Step 3: Remove Postgres Volume | ||
Remove the Postgres volume to ensure a clean state for the new database: | ||
|
||
```bash | ||
docker volume rm reportportal_postgres | ||
``` | ||
|
||
## Step 4: Download Latest Release | ||
Fetch the latest `docker-compose.yml` file to get the most recent version of ReportPortal: | ||
|
||
```bash | ||
curl -LO https://raw.githubusercontent.com/reportportal/reportportal/refs/heads/master/docker-compose.yml | ||
``` | ||
|
||
## Step 5: Run Postgres Container | ||
Start only the Postgres container to prepare for database restoration: | ||
|
||
```bash | ||
docker compose -p reportportal up -d postgres | ||
``` | ||
|
||
## Step 6: Restore Postgres Dump | ||
Restore the database dump into the new Postgres container: | ||
|
||
```bash | ||
docker exec -i -e PGPASSWORD=rppass postgres psql -U rpuser -d reportportal < reportportal24_1_postgres12_dump.sql > upgrade_db.log 2>&1 | ||
``` | ||
|
||
## Step 7: Run ReportPortal | ||
Bring up all the services for ReportPortal: | ||
|
||
```bash | ||
docker compose -p reportportal up -d | ||
``` | ||
|
||
## Final Notes | ||
- Verify that all services are running correctly using `docker ps` or checking the logs. | ||
- Keep the log file `upgrade_db.log` for any potential troubleshooting. | ||
- Regular backups are essential. Make sure to have a reliable strategy in place. |