Blog Post

Azure Database for PostgreSQL Blog
3 MIN READ

General Availability of Online Migration to Azure Database for PostgreSQL Flexible server

hariramt's avatar
hariramt
Icon for Microsoft rankMicrosoft
Oct 13, 2025

Introducing General Availability for Online migration from various source environments such as on-premises PostgreSQL, Azure VMs, Amazon RDS, Amazon Aurora, Google Cloud SQL and more to Azure Database for PostgreSQL - Flexible Server. This is particularly beneficial for mission-critical applications that require minimal downtime during migration.

Online migration minimizes downtime by keeping your source database operational during the migration process, with continuous data synchronization until cut over. 

How can I use Online migration?  

The Online migration is available in the Azure portal on the Migration setup screen, in the “Migration mode” drop down selection box, once you initiate a migration from the Flexible server page. 

Figure 1: Screenshot from the Azure Portal from the Migration setup page. Here you can select the “Online” migration mode to migrate from any of the listed PostgreSQL sources to Azure Database for PostgreSQL- Flexible server 

 

It can also be used from the Azure CLI by specifying the 'migration-mode' parameter as 'Online'.  

How does Online migration work?  

 

In an online database migration to Azure Database for PostgreSQL – Flexible Server, your application that is connecting to your Postgres source is not stopped while your database(s) are copied to Flexible Server target. Instead, the initial copy of the database(s) is followed by replication to keep the Postgres Flexible Server in sync with the Postgres source. 

 A cutover is performed when the Azure Database for PostgreSQL - Flexible Server is in complete sync with the Postgres source, resulting in minimal downtime. 

 

Figure 2: Cutover in Online migration:  Screenshot from the Migration status screen, where you can execute the cutover and complete the migration. The latency here is zero indicating that target Postgres Flex server is in sync with the source Postgres instance.  

 

In the ‘OnlineMigrationDemo’ above, the Latency is 0 which indicates that the Azure Database for PostgreSQL - Flexible Server is in sync with the source Postgres instance.   

 

Similarly, Online migration can be executed using the Command Line Interface (CLI) as well.  

 

Figure 3: Online migration through CLI:  Screenshot when you execute ‘show’ to get the Migration status displays latency for the individual Databases 

 

In the ‘OnlineMigrationDemo’ above, the Latency is 0 for the ‘customer-info’ Database being migrated which indicates that the target is in sync with the source.  

 

Whether you execute the migration from the Portal or the CLI, once the latency parameter decreases to 0 or close to 0, you can go ahead and execute the cutover to complete the migration. Before you execute the cutover, it is essential that you:  

  • Stop all writes at the source Postgres instance 
  • Validate the data that has been migrated to the target Flexible server  
  • Copy any custom server parameters and connection security details from the source to the target server  

Once you execute the cutover, the migration shows successful completion. At the point, ensure that you make changes to your application to point all connection strings to the Flexible server.  

What are the differences between Offline and Online migration?  

 

The following table gives an overview of Offline and Online modes of migration.  

Comparison of Migration modes 

Online 

Offline 

Ideal for small Databases  

 

    ✓ 

Simple to execute, with no manual intervention for cutover  

 

    ✓ 

Migrate without logical replication restrictions 

 

    ✓ 

Ideal for Production databases  

    ✓ 

 

Minimal downtime to Application & better user experience  

    ✓ 

 

 

Depending on the nature of your workload, you can choose either Offline or Online migration. 

 

Get started with Online migration 

 If you’re looking to migrate to Flexible Server from any of the listed PostgreSQL sources, you’ll find the Migration service overview quite useful.   

 If you only have a small downtime window in particular and you want to minimize the downtime of moving your production workloads from any compatible PostgreSQL source to Flexible Server, then Online migration could be a good fit for your situation. 

 

Where to find more info about Online migration for Azure Database for PostgreSQL – Flexible Server?  

 

Overview:How to migrate from your PostgreSQL source to Flexible server

Tutorials:

 

We’re always eager to hear from you, so please reach out to us at migrationpm@service.microsoft.com.

Updated Oct 10, 2025
Version 1.0
No CommentsBe the first to comment