From: | jjurban <jjurban(at)attglobal(dot)net> |
---|---|
To: | Thom Brown <thom(at)linux(dot)com> |
Cc: | Nuno Ferreira <nunoadferreira(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Copy database to another machine |
Date: | 2011-10-26 16:54:56 |
Message-ID: | 4EA83B60.1010708@attglobal.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Thom Brown wrote:
> On 26 October 2011 14:38, Nuno Ferreira <nunoadferreira(at)gmail(dot)com> wrote:
>
>> Good afternoon,
>> I'm trying to copy one database from one machine to another. How can I do
>> it?
>> Can I just simply copy and paste the files? I need to close the database
>> first or I can copy the files with it open?
>>
>
> No, you can't copy and paste the files, but you can do it in one step:
>
> pg_dump -t table_to_dump source_database_name | psql destination_database_name
>
> Assuming the table does't already exist in the destination, it will
> create and populate the table in the destination database.
>
I have zipped the contents of PGSDATA (the entire database) to a zip
file, copied that file to a memory stick, then unzipped it to another
machine.
This is on eCS (OS/2) machines.
I have done this many times without problems.
Am I doing something I shouldn't?
John
From | Date | Subject | |
---|---|---|---|
Next Message | jjurban | 2011-10-26 17:10:13 | Re: Copy database to another machine |
Previous Message | Thom Brown | 2011-10-26 16:46:06 | Re: Copy database to another machine |