feat: 'data:pg:migrate' command implementation (W-21303011)#3546
Merged
Conversation
- Disabling create target database option (backend isn't ready). - Adding validation that target database is available. - Linting fixes.
a16cfda to
0b2985c
Compare
0b2985c to
070f175
Compare
070f175 to
89bf020
Compare
heicheng18
reviewed
May 13, 2026
k80bowman
approved these changes
May 13, 2026
Contributor
k80bowman
left a comment
There was a problem hiding this comment.
This looks great and, when I ran it through it's paces, worked perfectly.
Applying CX review feedback. Co-authored-by: Helen Cheng <48834224+heicheng18@users.noreply.github.com> Signed-off-by: Santiago Bosio <santiago.bosio@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Here we implement a new
data:pg:migrateinteractive command that will allow customers to migrate Heroku Postgres Classic databases to the new Advanced tier.There's some heavy refactor on this PR around (now shared) behavior between
data:pg:createand the newdata:pg:migratecommand, given the latter needed a way to create an Advanced database as the target for a migration. Shared behavior was generalized and extracted toPoolConfig(in a similar way to what we did fordata:pg:createanddata:pg:update). While working on this we detected that we missed to copy the unit tests for thatPoolConfigmodule from the NGPG plugin. We fix that here, plus add new tests for the extracted shared behavior.Type of Change
Breaking Changes (major semver update)
!after your change type to denote a change that breaks current behaviorFeature Additions (minor semver update)
Patch Updates (patch semver update)
Testing
In order to test, checkout this branch, build the CLI and use the
./bin/runtool to run the command.There are a few ways to configure a migration, but basically you'll need to have at least one legacy (non-Advanced) database created on your test app. Then you can use the interactive option to create a target database on-the-fly as the destination for the migration or you can have an Advanced database already created and available and select it as destination.
After the migration tooling is prepared, your migration config should be
Readyfor either starting or canceling the migration. When canceled, you'll need to start again the configuration and wait for preparation. If started, the migration should run until it completes.The pair of databases (source and destination) that belong to a pending migration (any state between preparing and completed, failed or canceled) cannot be selected again as a source and destination for another migration. To test these scenarios you should have more than one legacy database on the test app to select as source.
Screenshots (if applicable)
Target selection
Migration config confirmation
Preparing migration after confirmation
Starting migration confirmation
Migration started
Related Issues
GUS work item: W-21303011