Skip to main content

Prerequisites

  • Azure Database for PostgreSQL instance
  • Access to Azure Portal
  • Xata account and project setup with a running main branch
  • Network access to your Azure database

Install and Configure the Xata CLI

Install the Xata CLI:
Authenticate with your Xata account:

Find the Azure Database connection string

Azure connection strings typically look like this:
You can find the database endpoint in the Azure console.

Initialize Xata project

Go to a local folder that you want to save the Xata configuration to and initialize it like this:
Select your organization and project you want to use. For the database name you can either choose a new one (e.g xata) or use the same that you have in Azure. If the database doesn’t exist, it will be created. In case you need to redo this step, you can reset the configuration by deleting the .xata/project.json file and running xata init again.

Start the migration

Begin the data transfer:
Depending on how large the source database is, this step might take a while. A progress bar will show you the progress in the CLI.

Verification

After migration, verify your data:
  1. Connect to Xata Branch:
  2. Check Data Integrity: