Error while upgrading to 17 from 14
hi, I’m getting the following error when upgrading from 14 to 17. mv: cannot move '/var/lib/postgresql/data/old' to a subdirectory of itself, '/var/lib/postgresql/data/old/old'
The PGDATA is /var/lib/postgresql/data Also the upgrade process continued, and seems like it completed successfully.
Can someone please explain this?
did you perhaps had another error before this one that made pgautoupgrade abort? that would explain why there is already an old directory.
as for the warning itself, I think this is nothing harmful, mv, as explained, cannot move things into itself.
No I didn't. It seems like the old dir created in my pgdata folder (which contains all files PG_VERSION etc.) Then the mv command try to move the files within that folder, an and the old dir itself also.
The pgdata folder is my Postgres data folder, I'm providing it to the pgautoupgrade, as the data folder then it creates an old directory and the command which moving the files in the pgdata directory trying to move also the /old into itself.
I'm missing something?
The issue comes from the mv -v "${PGDATA}"/* "${OLD}" line, as old/ already exists, it is expanded by the wildcard. The mv of old/ itself is not performed, so this is harmless but it would be cleaner to exclude old/ itself from the moves.