public inbox for [email protected]  
help / color / mirror / Atom feed
Re: How to validate restore of backup?
3+ messages / 2 participants
[nested] [flat]

* Re: How to validate restore of backup?
@ 2024-08-22 15:36 Adrian Klaver <[email protected]>
  2024-08-22 21:31 ` Re: How to validate restore of backup? Vince McMahon <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Adrian Klaver @ 2024-08-22 15:36 UTC (permalink / raw)
  To: Vince McMahon <[email protected]>; pgsql-generallists.postgresql.org <[email protected]>

On 8/22/24 04:06, Vince McMahon wrote:
> Hi,
> 
> I have some questions When doing pg_restore of backup of a database to a 
> NEW server.

How large a backup?

> 
> Is there a way to ensure the data integrity is in tact, and user ID and 
> access works liked how it was in the old server?

As to user access, write tests that cover that and run on the new cluster.

Data is trickier and if that is possible to a degree of certainty is 
going to depend on answer to the first question above.

> 
> How to properly handle the materialized views when backing up and restoring?

create materialized view prj_mv(p_item_no, year) as select p_item_no, 
year from projection with data;

pg_dump -d production -U postgres -h localhost -t projection -t prj_mv 
-f prj.sql

In prj.sql:

CREATE MATERIALIZED VIEW public.prj_mv AS
  SELECT p_item_no,
     year
    FROM public.projection
   WITH NO DATA;

COPY public.projection ( ...


[...]

REFRESH MATERIALIZED VIEW public.prj_mv;

It is done for you.

> 
> Thanks.

-- 
Adrian Klaver
[email protected]







^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: How to validate restore of backup?
  2024-08-22 15:36 Re: How to validate restore of backup? Adrian Klaver <[email protected]>
@ 2024-08-22 21:31 ` Vince McMahon <[email protected]>
  2024-08-23 00:15   ` Re: How to validate restore of backup? Adrian Klaver <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Vince McMahon @ 2024-08-22 21:31 UTC (permalink / raw)
  To: [email protected] <[email protected]>; +Cc: pgsql-generallists.postgresql.org <[email protected]>

Hi, Adrian.

The largest one is 8 GB after compression.

I have a window of 8 hours to handle 30 GB total of backup at various sizes.



On Thu, Aug 22, 2024, 11:36 AM Adrian Klaver <[email protected]>
wrote:

> On 8/22/24 04:06, Vince McMahon wrote:
> > Hi,
> >
> > I have some questions When doing pg_restore of backup of a database to a
> > NEW server.
>
> How large a backup?
>
> >
> > Is there a way to ensure the data integrity is in tact, and user ID and
> > access works liked how it was in the old server?
>
> As to user access, write tests that cover that and run on the new cluster.
>
> Data is trickier and if that is possible to a degree of certainty is
> going to depend on answer to the first question above.
>
> >
> > How to properly handle the materialized views when backing up and
> restoring?
>
> create materialized view prj_mv(p_item_no, year) as select p_item_no,
> year from projection with data;
>
> pg_dump -d production -U postgres -h localhost -t projection -t prj_mv
> -f prj.sql
>
> In prj.sql:
>
> CREATE MATERIALIZED VIEW public.prj_mv AS
>   SELECT p_item_no,
>      year
>     FROM public.projection
>    WITH NO DATA;
>
> COPY public.projection ( ...
>
>
> [...]
>
> REFRESH MATERIALIZED VIEW public.prj_mv;
>
> It is done for you.
>
> >
> > Thanks.
>
> --
> Adrian Klaver
> [email protected]
>
>


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: How to validate restore of backup?
  2024-08-22 15:36 Re: How to validate restore of backup? Adrian Klaver <[email protected]>
  2024-08-22 21:31 ` Re: How to validate restore of backup? Vince McMahon <[email protected]>
@ 2024-08-23 00:15   ` Adrian Klaver <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Adrian Klaver @ 2024-08-23 00:15 UTC (permalink / raw)
  To: Vince McMahon <[email protected]>; +Cc: pgsql-generallists.postgresql.org <[email protected]>

On 8/22/24 14:31, Vince McMahon wrote:
> Hi, Adrian.
> 
> The largest one is 8 GB after compression.
> 
> I have a window of 8 hours to handle 30 GB total of backup at various sizes.

I assume by compression you mean using some form of pg_dump -Fc.

As to your timeline determining whether that can be met is going to 
depend on a more detailed explanation on your part of what you expect 
from the dump/restore process.


-- 
Adrian Klaver
[email protected]







^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2024-08-23 00:15 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-08-22 15:36 Re: How to validate restore of backup? Adrian Klaver <[email protected]>
2024-08-22 21:31 ` Vince McMahon <[email protected]>
2024-08-23 00:15   ` Adrian Klaver <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox