Upgrade script fails on postgres backup

I’m trying to upgrade from 6.03 to 6.1 & this is my error…

Backing up PostgreSQL database in /mnt/2/var/www/videos.domain.org/peertube/backup/sql-peertube_prod-20240524-0813.bak
pg_dump: error: query failed: ERROR: permission denied for schema pgagent
pg_dump: detail: Query was: COPY pgagent.pga_jobagent (jagpid, jaglogintime, jagstation) TO stdout;

I’m not asked for a password. I had to edit my script.sh to include the proper directory.

Hi @Tyler_h

Since 24th may did you resolve your problem ?
For me, it is unclear what actions or pg_dump script arguments you did to create this backup.

Best Regards

I had to give my Postgres peertube user more rights in order to do the backup.

Stop the PeerTube service

sudo systemctl stop peertube && sudo su - postgres

pg_dump -Fc peertube_prod > ~/peertube_prod-dump.db

sudo systemctl start peertube

The file is located /var/lib/postgresql/

When restoring the rights remain postgres