Moving to another VNet

Ashwini Nighthack 0 Reputation points
2025-12-01T07:10:27.5966667+00:00

I want to move my Azure Database for PostgreSQL flexible server from one VNet to another. Both VNets are in the same resource group but in different regions. How to get it done?

Azure Database for PostgreSQL
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-01T07:10:40.7466667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To move your Azure Database for PostgreSQL flexible server from one VNet to another in different regions, you will need to follow these general steps:

    1. Prepare the Target VNet: Ensure that the target VNet is set up and configured properly in the destination region. This may include setting up necessary network peering, public IPs, or private endpoints as required.
    2. Export Resource Manager Template: You can export a Resource Manager template from the Azure portal that describes your current setup. This will help you replicate the configuration in the new region.
    3. Modify the Template: Adjust the exported template parameters to match the destination region. Ensure that the target server name is different from the source server name.
    4. Redeploy the Template: Deploy the modified template to the new region. This will create a new instance of your PostgreSQL flexible server in the target VNet.
    5. Migrate Data: You will need to migrate the data from the old server to the new one. This typically involves stopping all database activity on the source server, using tools like pg_dump to export the database, and then importing it into the new server.
    6. Update Clients: After the migration, reconfigure your clients to point to the new server and perform functional tests to ensure everything is working as expected.
    7. Clean Up: Once you have verified that the new server is functioning correctly, you can decommission the old server if it is no longer needed.

    Note that there may be downtime involved during the migration process, so plan accordingly.

    0 comments No comments

  2. VRISHABHANATH PATIL 1,820 Reputation points Microsoft External Staff Moderator
    2025-12-03T07:04:53.3+00:00

    Hi @Ashwini Nighthack
    Thank you for contacting to Microsoft QA.

    It sounds like you're looking to move your Azure Database for PostgreSQL flexible server to another VNet in a different region. Unfortunately, you can't directly move the server from one VNet to another once it's been deployed. Instead, you'll need to recreate the server in the new VNet and then perform a data migration.

    Here’s a step-by-step outline of what you can do:

    Create a New PostgreSQL Server in the Target VNet: Start by deploying a new Azure Database for PostgreSQL flexible server in the VNet where you want to move it. Make sure the new VNet is in the region you want.

    Set Up Networking: Ensure you configure the necessary networking for the new server, including any Virtual Network (VNet) peering if you need the two VNets to communicate.

    Data Migration: Use tools like pg_dump and pg_restore to migrate your data from the old server to the new one. You can also consider other backup and restore techniques depending on your needs.

    Update Applications: After the migration, make sure to update any applications or services that connect to your PostgreSQL server to use the new server's connection details.

    Here are some helpful documents to guide you through the process:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.