Databases grow over time, sometimes outgrowing the space on their original file system, and potentially leading to I/O contention. Whether you’re adding more space, evaluating ways to optimize performance, or looking to take advantage of other storage features, this tutorial will guide you through relocating PostgreSQL’s data directory. Select your operating system below to get started.
How To Move a PostgreSQL Data Directory to a New Location on Ubuntu 22.04
How To Move a PostgreSQL Data Directory to a New Location on Ubuntu 20.04
How To Move a PostgreSQL Data Directory to a New Location on Ubuntu 18.04
How To Move a PostgreSQL Data Directory to a New Location on Ubuntu 16.04