Is it safe to delete old postgresql directories?

Hi guys! Is it safe to delete data.12 and data.13 directories? data.12 seems to not be used, but there is still some activity in data.13. I’m on postgresql 14 for quite a while and don’t get why it still access files in data.13.

psql

Yes, it’s explained in the postgres upgrade to remove the old data.xx directories after the upgrade and when you’ve verified that Gitlab is working fine.

Easiest, just move them out of the directory they are in to say /tmp/data.xx so you can always move them back just in case. Ideally, stop Gitlab first with gitlab-ctl stop and then start gitlab again afterwards.

Also, first run gitlab-psql -V to make sure that you are on postgres 14.

2 Likes