Updating data for branch

Hey, I couldn’t find a thread on this.

I am looking for an easy way to update a branch I once created with the current main branch data.

My current workflow includes a permanent “development” branch. I use this permanently to create new features and extend my product. Once a feature is finished and merged, I usually want to update the data in my branch to the current state of the main database branch.
I do not want to create a new branch all the time, as this would also require me to replace all my env variables across all my setups.

Is there an “easy” solution to this that I have simply overlooked?
Or is dumping and importing the only solution for now?

Cheers
Michael

Is there an “easy” solution to this that I have simply overlooked?

We don’t (yet) have an easy solution that doesn’t require at least some work on your part, no.

Or is dumping and importing the only solution for now?

The only alternative to dump/restore is indeed to create a new branch from your main branch, and drop the old branch (if you don’t need the data in that branch). As you say, this also implies a changed endpoint and thus connection string.
Re-creating the branch is generally the fastest solution when the reconfiguration of connection strings isn’t taken into account, and dump/restore depends on the size of your database.

There are plans to allow you to re-assign endpoints to other branches (so that you don’t have to update your connection configurations), or to “reset” branches to a newer version of the main branch, but I don’t know when these features will become generally available.

This method of “refreshing a branch” using the Neon API might be an option for you. It will allow you to keep your current connection configuration.

1 Like