Search code examples
postgresqldatabase-administration

I have a question about postgreSQL cluster


I am new to programming. I used PostgreSQL because I needed a database program.

I made a data file using initdb.exe

initdb.exe -U postgres -A password -E utf8 -W -D D:\Develop\postgresql-10.17-2-windows-x64-binaries\data

This method is called a data cluster. I have put a lot of information into this data file. Now I want to transfer the data to another computer and use it. How do I import and use files created using a cluster? I want to register and use it in pgAdmin4. What should I do?

I am using a Windows 10 operating system. A solution similar to loading a cluster is required.


Solution

  • As long as you want to transfer to another 64-bit Windows system, you can just shut down the server and copy the data directory. Register a service with pg_ctl register if you want.

    To copy the data to a different operating system, you have to use pg_dumpall and restore with psql. pgAdmin won't help you there (it is not an administration tool, as its name would suggest).