Daily Snippet

PostgreSQL 9.2.1 move data folder

I found difficulty when I wanna move data folder of PostgreSQL. After googling stackoverflow, I try my own way:

1. Backup data folder.

2. Uninstall PostgreSQL and Re-Install PostgreSQL. Remember to use the same installer version.

I move folder installation from C to E.

3. Stop service.

4. Copy content of data backup folder and paste to folder data new installed. All the folder excep *.conf, *.pid, *.opts.

5. Start service. 

The theory is this won’t work if you try to upgrade from older PostgreSQL version. Use pg_upgrade instead.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s