Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZimJ-00086d-7l for pgsql-general@arkaria.postgresql.org; Fri, 15 May 2020 22:26:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jZimI-00014q-3A for pgsql-general@arkaria.postgresql.org; Fri, 15 May 2020 22:26:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZimH-00014j-OF for pgsql-general@lists.postgresql.org; Fri, 15 May 2020 22:26:01 +0000 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jZimE-00014I-Ve for pgsql-general@lists.postgresql.org; Fri, 15 May 2020 22:26:01 +0000 Received: by mail-oi1-x241.google.com with SMTP id o7so3677424oif.2 for ; Fri, 15 May 2020 15:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=MCO3Ax8yOx/cfKGp5VL+JABknxV9Ejx1p+pC+HfcFtg=; b=dVWKDnSIWJKCxGq4q09Iy1s+HHfzRqTBFtnkWvJlHPi/Z3X41fUlIfLfzm13ENAb+n IrAh91GiG6vsFVLJv2cVNuySg6ADF/0zV1o+41p6UXUQ3k2OD3AbE4npfoF/rj1ZH2ji aEgXPro3FsoTc7IDvq9xTFGwwfq+Q+tWY2Coc3fqgSxO99nal6Vym23UBw7JRS4vk0CA zo+sRLOYee4fpFrKaN7MOrIP0VKkn13tP3KKeCFmk9QTTweJqwhOD8SLGWJf+CGb/ggk WjmZGfU0664J7ZWsFwkYPVUSH0JBA0Y0iGltPcaa2q8v5xWgYMRvJQS6tE5I9QVZh/V/ tTaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=MCO3Ax8yOx/cfKGp5VL+JABknxV9Ejx1p+pC+HfcFtg=; b=etewyvq50ZRPjAOncHnUUaKnNsq8/UtR55nDYQHzeqFmBG9ufBD5Pf0/1Gr+7CBjlS w2o+caRga9VUxkqX01jOezbR5dutP4KJfgVz66G2WEeSpBlIOMc4u9DrnkvEuTGl4eDf 04xZTJfTtVPyd5M98Fx69t7gmuwhL+Z65sbLeksp99tZxpjb6ueSfESS74V2YH34Vurd oW3Bh60pBxj6bUdJT6qEZLEEFkaRcIHtC8oRTiFhEmFGjmPYSngYdaPfWGxmT1Yz4DWB jlndy9gG0b1IgXO4ixAALKzDobrCyaPI4Kay1Ae23iSffBsr15BrGme4jX1hMeSb4dek 1Vqg== X-Gm-Message-State: AOAM533HEdbv8RkpF3nPctlNXahTEQwiygQ/LQ/GFITdNGepC4DeGEFh YQp5YkMuNJ71fnheVOWHmRrZl7zO97g= X-Google-Smtp-Source: ABdhPJzzdxdla/sT48AMwCI/HYdd79y13MCoAcnpkVOwA5cSVlm+Zn5XvuJPhOEHDiqMJx5FS0VTiA== X-Received: by 2002:a05:6808:10b:: with SMTP id b11mr3584806oie.82.1589581556468; Fri, 15 May 2020 15:25:56 -0700 (PDT) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id t26sm890985otl.71.2020.05.15.15.25.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 May 2020 15:25:55 -0700 (PDT) Subject: Re: Inherited an 18TB DB & need to backup To: pgsql-general@lists.postgresql.org References: <20200515130246.GB25570@campbell-lange.net> From: Ron Message-ID: Date: Fri, 15 May 2020 17:25:55 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------614CBA589CC55F62203BB6B8" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------614CBA589CC55F62203BB6B8 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit For a database that size, I'd install pgbackrest, since it features parallel backups and compression.  With it, I'd do monthly full backups with daily differential backups. (If it's mostly historical data, I'd split the database into multiple instances, so that older data rarely needs to be backed up. The application, of course, would have to be modified.) On 5/15/20 8:26 AM, Suhail Bamzena wrote: > Thanks Rory, the machine has the capacity to pull through pg_dumps but > like u rightly mentioned incremental backups mean that we will need to > work with the wal's.. 18TB is what is the scary part and with compression > I dont see it being less than 2TB a day... > > On Fri, 15 May 2020, 17:02 Rory Campbell-Lange, > wrote: > > On 15/05/20, Suhail Bamzena (suhailsalem@gmail.com > ) wrote: > > Hello All, > > I have very recently inherited an 18 TB DB that is running version 9.2. > > Apparently this database has never been backed up and I have been > tasked to > > set in a periodic backup routine (weekly full & daily incremental) > and dump > > it into a NAS. What is the best way to go about this? Did some > reading and > > hear that pgbackrest does a good job with such huge sizes. Your expert > > advise is needed. > > Incremental backups suggest the need to backup WAL archives. See > https://www.postgresql.org/docs/9.2/continuous-archiving.html > > pgbackrest looks very cool but we haven't used it. > > A very simple solution could be just to dump the database daily with > pg_dump, if you have the space and machine capacity to do it. Depending > on what you are storing, you can achieve good compression with this, and > it is a great way of having a simple file from which to restore a > database. > > Our ~200GB cluster resolves to under 10GB of pg_dump files, although > 18TB is a whole different order of size. > > Rory > -- Angular momentum makes the world go 'round. --------------614CBA589CC55F62203BB6B8 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit For a database that size, I'd install pgbackrest, since it features parallel backups and compression.  With it, I'd do monthly full backups with daily differential backups.

(If it's mostly historical data, I'd split the database into multiple instances, so that older data rarely needs to be backed up. The application, of course, would have to be modified.)

On 5/15/20 8:26 AM, Suhail Bamzena wrote:
Thanks Rory, the machine has the capacity to pull through pg_dumps but like u rightly mentioned incremental backups mean that we will need to work with the wal's.. 18TB is what is the scary part and with compression I dont see it being less than 2TB a day...

On Fri, 15 May 2020, 17:02 Rory Campbell-Lange, <rory@campbell-lange.net> wrote:
On 15/05/20, Suhail Bamzena (suhailsalem@gmail.com) wrote:
> Hello All,
> I have very recently inherited an 18 TB DB that is running version 9.2.
> Apparently this database has never been backed up and I have been tasked to
> set in a periodic backup routine (weekly full & daily incremental) and dump
> it into a NAS. What is the best way to go about this? Did some reading and
> hear that pgbackrest does a good job with such huge sizes. Your expert
> advise is needed.

Incremental backups suggest the need to backup WAL archives. See
https://www.postgresql.org/docs/9.2/continuous-archiving.html

pgbackrest looks very cool but we haven't used it.

A very simple solution could be just to dump the database daily with
pg_dump, if you have the space and machine capacity to do it. Depending
on what you are storing, you can achieve good compression with this, and
it is a great way of having a simple file from which to restore a
database.

Our ~200GB cluster resolves to under 10GB of pg_dump files, although
18TB is a whole different order of size.

Rory

--
Angular momentum makes the world go 'round.
--------------614CBA589CC55F62203BB6B8--