Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: PostgreSQL guy in the house? - WAS: Re: [gentoo-user] Serious problem with linode vm
Date: Tue, 16 Apr 2013 03:59:34
Message-Id: 16933180-3cae-48c5-84cf-aa8744dfef19@email.android.com
In Reply to: PostgreSQL guy in the house? - WAS: Re: [gentoo-user] Serious problem with linode vm by Tanstaafl
1 Tanstaafl <tanstaafl@×××××××××××.org> wrote:
2
3 >On 2013-04-15 3:11 PM, Michael Mol <mikemol@×××××.com> wrote:
4 >> If this were me, I would set up a clean install from scratch. No, I
5 >> wouldn't use a x86 userspace with a x64 kernel, but that's because of
6 >> the benefits I see with the 64-bit arch, not with any issues I'd be
7 >> aware of from using an x64 kernel with an x32 userspace.
8 >
9 >I understand and agree, and am doing that as we speak.
10 >
11 >I was just trying to get it back up and running quickly, but that
12 >didn't
13 >happen.
14 >
15 >Ok - now... is there a postgresql guy in the house?
16 >
17 >Can someone confirm that the command I need to use to dump the entire
18 >pg
19 >database for a full restore on a new/clean machine would be:
20 >
21 >pg_dumpall --username=username -o -f /home/myuser/mydb_backup.sql.gz
22 >
23 >?
24 >
25 >Will that get everything?
26 >
27 >I'm also planning on stopping pg (it is running ok, it is PHP that is
28 >the problem), then just
29 >
30 >tar -pvczf /home/myuser/pg91_data.tar.gz /var/lib/postgresql/9.1/data
31 >
32 >will that suffice as another backup of all of the data that could be
33 >used for restoration?
34 >
35 >Thanks guys... this was not a fun day...
36
37 Tanstaafl.
38
39 The "pg_dumpall" command will generate SQL scripts to restore the entire datastructure and data needed to rebuild the entire database server.
40 The SQL will not be compressed. So I would leave the .gz off the filename.
41
42 You will also need the configuration files "pg_hba.conf" and "postgresql.conf". (Doing this from memory on my mobile.)
43
44 Best also have a quick check on the postgresql website and mailing list.
45
46 The last migration to a new server was done by backing up every database seperately using the "pg_dump" command.
47 This made restoring simpler because the template databases already exist when the database is running.
48
49 The tar-command will also get nearly everything if you kept the default locations. Restoring that should also suffice if you restore it to a 9.1 postgresql.
50 Don't forget the files in /etc/postgresql*/
51
52 Any questions. Put them on here. I'm off to my customer soon. Should be back on email in about 1.5 hours...
53
54 --
55 Joost Roeleveld
56 --
57 Sent from my Android phone with K-9 Mail. Please excuse my brevity.