<p>I was trying to upgrade from bitnami pg image 11 -&gt; version 14.  When trying to do so i was prompted with the following error:</p>
<p><code>The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 14.0</code></p>
<p>In order to get around this, I created a new postgres deployment with a new PVC, used pgdump to take a backup of the data and imported it within the new postgres deployment which is running version 14.</p>
<p>However I'm going to need to repeat this process on larger databases which terabytes of data and don't think pgdump is going to be sufficient.</p>
<p>With the bitnami image is it possible to use the likes of pg_upgrade?</p>

krobbo
<p>Yeah, backup and restoring the way you did is always a good option with new <strong>PVC</strong> and <strong>PV</strong>.</p>
<p>Pg_dump &amp; Pg_restore is a robust native option i think you can use the <code>-j</code> to start the multiple <strong>threads</strong> to migrate the data.</p>
<p>To migrate the TB of data you might need good Network bandwidth and a scalable solution.</p>
<p>Not sure how you are running this instances or replicas.</p>
<p>You can do something like :</p>
<p>Create <strong>new</strong> helm release of <strong>Postgres</strong> while the <strong>old</strong> one running</p>
<p>Migrate the data</p>
<pre><code>kubectl exec -it new-helm-db-postgresql-0 -- bash -c 'export PGPASSWORD=${POSTGRES_PASSWORD}; time pg_dump -h old-postgresql -U postgres | psql -U postgres'
</code></pre>
<p>As suggested above you can add the <code>-j</code> also to start multi threads however it will increase the resources of POD and Disk usage if migrating TB of data.</p>
<p>You can also refer : <a href="https://www.citusdata.com/blog/2021/02/20/faster-data-migrations-in-postgres/" rel="nofollow noreferrer">https://www.citusdata.com/blog/2021/02/20/faster-data-migrations-in-postgres/</a></p>
<p>i would like to suggest using the <strong>DMS AWS</strong> if you are on the managed cloud.</p>
<p>Or else setting up one <strong>VM</strong> with <a href="https://github.com/urbica/pg-migrate" rel="nofollow noreferrer">Migration Tool</a> and migrating data to old postgres cluster to new.</p>
