pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedRecommended way to copy database files on Windows OS (to perform file system level backup)
5+ messages / 5 participants
[nested] [flat]
* Recommended way to copy database files on Windows OS (to perform file system level backup)
@ 2018-05-14 11:22 Yashwanth Govinda Setty <ygovindasetty@commvault.com>
0 siblings, 3 replies; 5+ messages in thread
From: Yashwanth Govinda Setty @ 2018-05-14 11:22 UTC (permalink / raw)
To: pgsql-general; +Cc: Girish Rao <grao@commvault.com>
Hi all,
We are facing this problem while performing file system level backup of database files:
As each database will form a directory inside Base directory which consists of files representing the tables, when some tables are dropped during backup, We get error while copying since the files do not exist anymore.
So we would like to know how you recommend copying PostgreSQL database files in Windows OS to perform file system level backups.
(For Example - The recommended way in Linux is to use tar format.)
Thanks,
Yashwanth
***************************Legal Disclaimer***************************
"This communication may contain confidential and privileged material for the
sole use of the intended recipient. Any unauthorized review, use or distribution
by others is strictly prohibited. If you have received the message by mistake,
please advise the sender by reply email and delete the message. Thank you."
**********************************************************************
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Recommended way to copy database files on Windows OS (to perform file system level backup)
@ 2018-05-14 13:43 James Keener <jim@jimkeener.com>
parent: Yashwanth Govinda Setty <ygovindasetty@commvault.com>
2 siblings, 0 replies; 5+ messages in thread
From: James Keener @ 2018-05-14 13:43 UTC (permalink / raw)
To: Yashwanth Govinda Setty <ygovindasetty@commvault.com>; +Cc: pgsql-general; Girish Rao <grao@commvault.com>
A bit of pedanticism:
> So we would like to know how you recommend copying PostgreSQL database
files in Windows OS to perform file system level backups.
(For Example – The recommended way in Linux is to use tar format.)
That is not what a file-system-level back up is, and not what tar does at
all. Tar basically creates a file that contains other files, and would be
subject to the same issues a copy would be.
A file-system level backup is just that, a backup done by the file system
itself, usually via an atomic snapshot. LVM, ZFS, and BTFS are all capable
of doing this in Linux and *BSD. The filesystem will store the current
state of the filesystem somewhere in an atomic manner, i.e. nothing else
happens when the snapshot is made.
I think NTFS can do volume shadow copies, but I havn't used windows in
perhaps a decade and have never done so as an admin or professionally.
Jim
On Mon, May 14, 2018 at 7:22 AM, Yashwanth Govinda Setty <
ygovindasetty@commvault.com> wrote:
> Hi all,
>
>
>
> We are facing this problem while performing file system level backup of
> database files:
>
> As each database will form a directory inside Base directory which
> consists of files representing the tables, when some tables are dropped
> during backup, *We get error while copying since the files do not exist
> anymore*.
>
>
>
> So we would like to know how you recommend copying PostgreSQL database
> files in Windows OS to perform file system level backups.
>
> (For Example – The recommended way in Linux is to use tar format.)
>
>
>
> Thanks,
>
> *Yashwanth*
>
>
> ***************************Legal Disclaimer***************************
> "This communication may contain confidential and privileged material for
> the
> sole use of the intended recipient. Any unauthorized review, use or
> distribution
> by others is strictly prohibited. If you have received the message by
> mistake,
> please advise the sender by reply email and delete the message. Thank you."
> **********************************************************************
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Recommended way to copy database files on Windows OS (to perform file system level backup)
@ 2018-05-14 13:48 Allan Kamau <kamauallan@gmail.com>
parent: Yashwanth Govinda Setty <ygovindasetty@commvault.com>
2 siblings, 1 reply; 5+ messages in thread
From: Allan Kamau @ 2018-05-14 13:48 UTC (permalink / raw)
To: Yashwanth Govinda Setty <ygovindasetty@commvault.com>; +Cc: pgsql-general; Girish Rao <grao@commvault.com>
On Mon, May 14, 2018 at 2:22 PM, Yashwanth Govinda Setty <
ygovindasetty@commvault.com> wrote:
> Hi all,
>
>
>
> We are facing this problem while performing file system level backup of
> database files:
>
> As each database will form a directory inside Base directory which
> consists of files representing the tables, when some tables are dropped
> during backup, *We get error while copying since the files do not exist
> anymore*.
>
>
>
> So we would like to know how you recommend copying PostgreSQL database
> files in Windows OS to perform file system level backups.
>
> (For Example – The recommended way in Linux is to use tar format.)
>
>
>
> Thanks,
>
> *Yashwanth*
>
>
> ***************************Legal Disclaimer***************************
> "This communication may contain confidential and privileged material for
> the
> sole use of the intended recipient. Any unauthorized review, use or
> distribution
> by others is strictly prohibited. If you have received the message by
> mistake,
> please advise the sender by reply email and delete the message. Thank you."
> **********************************************************************
>
An easy way to perform backup of your data is to use PostgreSQL's very own
pg_dump utility.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Recommended way to copy database files on Windows OS (to perform file system level backup)
@ 2018-05-14 14:14 Christoph Moench-Tegeder <cmt@burggraben.net>
parent: Yashwanth Govinda Setty <ygovindasetty@commvault.com>
2 siblings, 0 replies; 5+ messages in thread
From: Christoph Moench-Tegeder @ 2018-05-14 14:14 UTC (permalink / raw)
To: Yashwanth Govinda Setty <ygovindasetty@commvault.com>; +Cc: pgsql-general; Girish Rao <grao@commvault.com>
## Yashwanth Govinda Setty (ygovindasetty@commvault.com):
> We are facing this problem while performing file system level backup of database files:
> As each database will form a directory inside Base directory which consists of files representing the tables, when some tables are dropped during backup, We get error while copying since the files do not exist anymore.
This looks like you read only the first sentence of the relevant
documentation:
https://www.postgresql.org/docs/current/static/backup-file.html
The "recommended way" is not "use tar", but to heed both restrictions
mentioned there. Especially, if you want to do a naive copy of the files,
the database has to be shut down.
If shutting down the database is not an option (most cases), your
option is a "base backup" - there's pg_basebackup to help you with
that, and you can do that "the hard way" with the low level API.
Both approaches are described here:
https://www.postgresql.org/docs/current/static/continuous-archiving.html#BACKUP-BASE-BACKUP
This is mostly independent from the OS - but you have to make sure to
follow the process (shutting down the database beforehand, or do the
full base backup) - else the database will be corrupted after restore
and may even fail to start.
Regards,
Christoph
--
Spare Space.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Recommended way to copy database files on Windows OS (to perform file system level backup)
@ 2018-05-14 17:01 Andreas Kretschmer <andreas@a-kretschmer.de>
parent: Allan Kamau <kamauallan@gmail.com>
0 siblings, 0 replies; 5+ messages in thread
From: Andreas Kretschmer @ 2018-05-14 17:01 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org; Allan Kamau <kamauallan@gmail.com>; Yashwanth Govinda Setty <ygovindasetty@commvault.com>; +Cc: pgsql-general; Girish Rao <grao@commvault.com>
>An easy way to perform backup of your data is to use PostgreSQL's very
>own
>pg_dump utility.
That's not a file level backup, but a logical backup. Maybe he wants to build standby for streaming replication, for this you needs an other backup. See the answer from Christoph.
Andreas
--
2ndQuadrant - The PostgreSQL Support Company
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2018-05-14 17:01 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-05-14 11:22 Recommended way to copy database files on Windows OS (to perform file system level backup) Yashwanth Govinda Setty <ygovindasetty@commvault.com>
2018-05-14 13:43 ` James Keener <jim@jimkeener.com>
2018-05-14 13:48 ` Allan Kamau <kamauallan@gmail.com>
2018-05-14 17:01 ` Andreas Kretschmer <andreas@a-kretschmer.de>
2018-05-14 14:14 ` Christoph Moench-Tegeder <cmt@burggraben.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox