Permission error using `pgcopydb clone --follow`
What
I get a permission error when I try to run
pgcopydb clone --follow
to run a continuous migration from my source db in Amazon to my target db in Neon. It looks like the pgcopydb
tool cannot create the necessary replication objects on the Neon side using the sales_owner
user that I set up in my Neon project. Here is the relevant part of the error message (I will reply with rest of the error):
How can I set up my Neon instance so that I can run pgcopydb
with the --follow
option?
Why
I want to perform as seamless a migration as I can from my current production database to my new production database in Neon. pgcopydb clone
works fine if I want to dump and restore and stop there. But I'd like to do a dump, restore and continuously run a replication until I do the switch-over.
How
First I followed the instructions to migrate from Aurora to Neon using DMS here: https://neon.tech/docs/import/migrate-aws-dms
I tried to run the migration using DMS but it failed to work AND I was unable to set up the permissions properly so that the migration service could log out the error statements to debug the issue. After a day of fiddling with it and getting nowhere, I switched to use pgcopydb
.
pgcopydb
is a tool which uses pg_dump
and pg_restore
to migrate data from one Postgres server to another in an efficient way. One of the things that pgcopydb
allows you to do is to clone and then "follow" changes which replicates changes from source to target until you terminate the process. This is appealing because it makes it possible for us to get 99% of the migration done up front and then perform the cut-over when we are ready. I was hoping to do this with DMS but I couldn't get it working.
I am able to copy the data using pgcopydb clone
. But as soon as I add the --follow
argument I get the error that I mentioned above.Neon
Migrate with AWS Database Migration Service (DMS) - Neon Docs
This guide outlines the steps for using the AWS Database Migration Service (DMS) to migrate data to Neon from another hosted database server. AWS DMS supports a variety of database migration sources i...
9 Replies
flat-fuchsiaOP•2y ago
Here's the full error output:
sensitive-blue•2y ago
Hey! Logical replication is not currently available. We plan on shipping an update soon. Right now, the only way to migrate your data is to use pg_dump directly.
sensitive-blue•2y ago
cc @Daniel might be worth documenting pgcopydb once we support logical replication
https://github.com/dimitri/pgcopydb
GitHub
GitHub - dimitri/pgcopydb: Copy a Postgres database to a target Pos...
Copy a Postgres database to a target Postgres server (pg_dump | pg_restore on steroids) - dimitri/pgcopydb
optimistic-gold•2y ago
This would be a nice addition. I've put it on our task board.
flat-fuchsiaOP•2y ago
Hey @Mahmoud, thanks for letting me know. I thought that might be the case. Good to get confirmation! Cheers
genetic-orange•2y ago
Hey @Cody,
While logical replication gets rolled out, if you want to migrate and test out neon with pg_dump and pg_restore, try out using the
@neondatabase/migrate-pg
package ⬇️
https://github.com/neondatabase/migrate-pg
Would love to hear any kind of feedback if you end up trying it.flat-fuchsiaOP•2y ago
A follow-up question: given what @Mahmoud said:
Logical replication is not currently availableThat sounds like I won't be able to use DMS for the same purpose either, correct? Copy + replicate?
sensitive-blue•2y ago
yea pg_dump is the only way to import data into Neon for now
unless AWS DMS provides a way that doesn't use logical replication
optimistic-gold•2y ago
You don't require logical replication for AWS DMS. We provide some instructions here, but those instructions are based on a sample dataset that was not being actively modified: https://neon.tech/docs/import/migrate-aws-dms
Neon
Migrate with AWS Database Migration Service (DMS) - Neon Docs
This guide outlines the steps for using the AWS Database Migration Service (DMS) to migrate data to Neon from another hosted database server. AWS DMS supports a variety of database migration sources i...