pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Move database
Date: Tue, 10 Nov 2020 08:16:43 -0600
Message-ID: <100b9c34-6b52-c8a6-91de-3cbff6de87c6@gmail.com> (raw)
In-Reply-To: <A631D97B-6644-4935-849A-F4E8E57C6F31@gmail.com>
References: <CALhHtcAyu3Q-YnFjgGxkZc9dBkCFLvi8-E1AJ44ayA=SSuZTJQ@mail.gmail.com>
	<A631D97B-6644-4935-849A-F4E8E57C6F31@gmail.com>

On 11/10/20 8:11 AM, Paul Förster wrote:
> Hi Yambu,
>
>> On 10. Nov, 2020, at 14:48, Yambu <hyambu@gmail.com> wrote:
>> What is the best way to move a database from one VM to another without losing records from updating applications?
> I assume you want to minimize down time? If so, set up a streaming replication on the new VM and let PostgreSQL copy the whole database over by itself as a standby database. After copying is finished and both databases are completely in sync, then shut down the old (primary) database and promote the standby database. After that, you can delete the old database.
>
> Assuming you can afford the down time, there is always the option of shutting the database down and scp or rsync it to the new VM and start it there.
>
> If you run it on some external storage like mounted NFS filesystems, you can shut it down, umount the NFS volume(s) on the old VM, mount the NFS volume(s) on the new VM and start it there.
>
> It really depends on your system (storage) architecture.

Given this set of circumstances, they could dismount the LUNs from VM-old, 
and mount them on VM-new:
* it's on a SAN,
* they're keeping the same version number,
* the database files are on dedicated mount points.

-- 
Angular momentum makes the world go 'round.





view thread (6+ messages)  latest in thread

Message-ID: <100b9c34-6b52-c8a6-91de-3cbff6de87c6@gmail.com>
Permalink:  ../100b9c34-6b52-c8a6-91de-3cbff6de87c6@gmail.com/
Also on:    postgresql.org/message-id/100b9c34-6b52-c8a6-91de-3cbff6de87c6@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Move database
  In-Reply-To: <100b9c34-6b52-c8a6-91de-3cbff6de87c6@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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