Skip to content

Commit 92aad73

Browse files
authored
Merge pull request #51 from NikhilRaikwar/upgrade/postgres-18-v7
docs: add PostgreSQL v16 to v18 migration guide for v7.0.0
2 parents d0e10aa + 46dcd64 commit 92aad73

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

docs/IntelOwl/installation.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,74 @@ Maintainers strive to keep the upgrade between major version easy but it's not a
356356
Below you can find the additional process required to upgrade from each major versions.
357357
</div>
358358

359+
#### Updating to >=7.0.0 from a 6.x.x version
360+
361+
*Note: Version 7.0.0 is not yet officially released; this guide is provided for the upcoming major update.*
362+
363+
IntelOwl v7.0.0 updated the base PostgreSQL image from version 16 to version 18. This change is a breaking change for the database data. You have two choices:
364+
365+
- **Choice 1: Start from scratch**: Remove your actual database volumes and start from scratch with a new one.
366+
- **Choice 2: Migrate your data**: Follow the migration procedure below to move your data from PostgreSQL 16 (v6.x.x) to PostgreSQL 18 (v7.0.0).
367+
368+
<div class="admonition warning">
369+
<p class="admonition-title">Warning</p>
370+
CARE! We are providing this database migration procedure to help the users to migrate to a new PostgreSQL version.
371+
372+
Upgrading PostgreSQL is outside the scope of the IntelOwl project so we do not guarantee that everything will work as intended.
373+
374+
In case of doubt, please check the official PostgreSQL documentation.
375+
376+
Upgrade at your own risk.
377+
378+
</div>
379+
380+
The database migration procedure is as follows:
381+
382+
1. Ensure IntelOwl version 6.x.x is up and running.
383+
2. Bring down the application:
384+
```bash
385+
./start prod down
386+
```
387+
3. Go to the docker folder: `cd docker`
388+
4. Start a temporary PostgreSQL 16 container with your old data:
389+
```bash
390+
docker run -d --name intelowl_postgres_16 -v <OLD_POSTGRES_VOLUME>:/var/lib/postgresql/data/ --env-file env_file_postgres library/postgres:16-alpine
391+
```
392+
*Note: `<OLD_POSTGRES_VOLUME>` is usually `intelowl_postgres_data` or `postgres_data` depending on your Docker project name.*
393+
5. Dump the entire database:
394+
```bash
395+
docker exec -t intelowl_postgres_16 pg_dump -U <POSTGRES_USER> -d <POSTGRES_DB> --no-owner > /tmp/intelowl_v6_dump.sql
396+
```
397+
*Replace `<POSTGRES_USER>` and `<POSTGRES_DB>` with your actual values from `env_file_postgres`.*
398+
6. Stop and remove the temporary container:
399+
```bash
400+
docker container stop intelowl_postgres_16
401+
docker container rm intelowl_postgres_16
402+
```
403+
7. Start a temporary PostgreSQL 18 container using the new volume name:
404+
```bash
405+
docker run -d --name intelowl_postgres_18 -v intelowl_postgres_data_v18:/var/lib/postgresql/data/ --env-file env_file_postgres library/postgres:18-alpine
406+
```
407+
8. Restore the data:
408+
```bash
409+
cat /tmp/intelowl_v6_dump.sql | docker exec -i intelowl_postgres_18 psql -U <POSTGRES_USER> -d <POSTGRES_DB>
410+
```
411+
9. Stop and remove the temporary container:
412+
```bash
413+
docker container stop intelowl_postgres_18
414+
docker container rm intelowl_postgres_18
415+
```
416+
10. Update your IntelOwl repository to the latest version (v7.0.0).
417+
11. Bring the application back up:
418+
```bash
419+
./start prod up
420+
```
421+
12. (Optional) Once you have verified that everything works properly, you can remove the old PostgreSQL volume.
422+
**Warning**: This will permanently delete your original data/backup.
423+
```bash
424+
docker volume rm <OLD_POSTGRES_VOLUME>
425+
```
426+
359427
#### Updating to >=6.0.0 from a 5.x.x version
360428

361429
IntelOwl v6 introduced some major changes regarding how the project is started.

0 commit comments

Comments
 (0)