Обсуждение: Move datapath

Поиск
Список
Период
Сортировка

Move datapath

От
Rajesh Kumar
Дата:
Hi all,

I have a postgres database 15.3 that ran on kubernetes and the pod had crashbackloop error.

And devops looks like created another datapath and now pod is running.

Now when connect to terminal of that pod  I could see two folders 1. Postgresql-24 (old data path that has data and looks like not running ) 2. Postgresql-25 (new data path which seems to be running currently)

Now I want to have data in postgresql-25. How do I get it from postgresql-24? Kindly help me .

Re: Move datapath

От
Ron Johnson
Дата:
On Wed, Jan 15, 2025 at 2:25 PM Rajesh Kumar <rajeshkumar.dba09@gmail.com> wrote:
Hi all,

I have a postgres database 15.3 that ran on kubernetes and the pod had crashbackloop error.

And devops looks like created another datapath and now pod is running.

Now when connect to terminal of that pod  I could see two folders 1. Postgresql-24 (old data path that has data and looks like not running ) 2. Postgresql-25 (new data path which seems to be running currently)

Now I want to have data in postgresql-25. How do I get it from postgresql-24? Kindly help me .

Postgresql only cares about the $PGDATA environment variable and the datadir pointed to by "--pgdata=datadir".  That's the answer to your question.

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

Re: Move datapath

От
Mohit Mishra
Дата:

Hello Rajesh,

did you try doing backup from pg24 and then restoring it in pg25 ---> you can use pg_dum or pg_restore

Regards,

Mohit


On Thu, 16 Jan 2025, 00:55 Rajesh Kumar, <rajeshkumar.dba09@gmail.com> wrote:
Hi all,

I have a postgres database 15.3 that ran on kubernetes and the pod had crashbackloop error.

And devops looks like created another datapath and now pod is running.

Now when connect to terminal of that pod  I could see two folders 1. Postgresql-24 (old data path that has data and looks like not running ) 2. Postgresql-25 (new data path which seems to be running currently)

Now I want to have data in postgresql-25. How do I get it from postgresql-24? Kindly help me .

Re: Move datapath

От
Rajesh Kumar
Дата:

Hi Mohit, pg24 seems to be crashed and could not connect to take back up and all.

Also I understand it care about datadir only. But at this point, what's the best possible way to solve this?

The old data is in /data/pg24 , can I load this in /data/pg25 and need to reinitialize the wal db checkpoint

On Thu, 16 Jan 2025, 01:04 Mohit Mishra, <mohitmishra786687@gmail.com> wrote:

Hello Rajesh,

did you try doing backup from pg24 and then restoring it in pg25 ---> you can use pg_dum or pg_restore

Regards,

Mohit


On Thu, 16 Jan 2025, 00:55 Rajesh Kumar, <rajeshkumar.dba09@gmail.com> wrote:
Hi all,

I have a postgres database 15.3 that ran on kubernetes and the pod had crashbackloop error.

And devops looks like created another datapath and now pod is running.

Now when connect to terminal of that pod  I could see two folders 1. Postgresql-24 (old data path that has data and looks like not running ) 2. Postgresql-25 (new data path which seems to be running currently)

Now I want to have data in postgresql-25. How do I get it from postgresql-24? Kindly help me .

Re: Move datapath

От
Andreas Froede
Дата:
Hi


> The old data is in /data/pg24 , can I load this in /data/pg25 and need 
> to reinitialize the wal db checkpoint


If you copy the datadir, you have probably moved the problem 1:1 to pg25.

You should use your daily backup from pg24 or fix the issue in pg24.

What do your logs say about the problem on pg24?



CIAO
andreas