Обсуждение: Restoring databases from a different installment on Windows

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

Restoring databases from a different installment on Windows

От
"Berislav Lopac"
Дата:
I have recently reinstalled my Windows mychine, including the
PostgreSQL server, but (due to a system crash, unrelated to Postgres) I
wasn't able to dump my databases to import them now. However, I have a
full copy of the original system, including all the files of the
original Postgres installation.

Is there a way to restore the databases from the original installation
into the new one? For example, in MySQL I would be able to just copy
the data files; is there something similar in Postgres?

Thanks,

Berislav


Re: Restoring databases from a different installment on Windows

От
Bruno Wolff III
Дата:
On Sun, May 28, 2006 at 07:24:56 -0700,
  Berislav Lopac <berislav.lopac@gmail.com> wrote:
> I have recently reinstalled my Windows mychine, including the
> PostgreSQL server, but (due to a system crash, unrelated to Postgres) I
> wasn't able to dump my databases to import them now. However, I have a
> full copy of the original system, including all the files of the
> original Postgres installation.
>
> Is there a way to restore the databases from the original installation
> into the new one? For example, in MySQL I would be able to just copy
> the data files; is there something similar in Postgres?

Yes it should work. There should be a recovery if postgres was running when
the boc crashed.
Note, you don't want to copy files out from under a running server to do
backups. That won't work.

Re: Restoring databases from a different installment on Windows

От
"Berislav Lopac"
Дата:
Bruno Wolff III wrote:
> Yes it should work. There should be a recovery if postgres was running when
> the boc crashed.
> Note, you don't want to copy files out from under a running server to do
> backups. That won't work.

Actually, my situation is like this:

I had a properly running version of Postgres when my Windows crashed. I
Installed a fresh copy on Windows on another disk, and then Postgres on
top of it. Then I started the system from the new Windows, stopped the
Postgres service and copied the data directory from the old system to
the new one, but Postgres service refused to start.

So it was not some kind of a backup copy, it was a regular directory of
another installation.

Any ideas?

Thanks,

Berislav


Re: Restoring databases from a different installment on Windows

От
Bruno Wolff III
Дата:
On Wed, May 31, 2006 at 00:26:02 -0700,
  Berislav Lopac <berislav.lopac@gmail.com> wrote:
>
> Actually, my situation is like this:
>
> I had a properly running version of Postgres when my Windows crashed. I
> Installed a fresh copy on Windows on another disk, and then Postgres on
> top of it. Then I started the system from the new Windows, stopped the
> Postgres service and copied the data directory from the old system to
> the new one, but Postgres service refused to start.
>
> So it was not some kind of a backup copy, it was a regular directory of
> another installation.

That's pretty much the same thing.
I think that approach should work.

> Any ideas?

What do your logs say?