Prerequisites
- Azure Database for PostgreSQL instance
- Access to Azure Portal
- Xata account and project setup
- Network access to your Azure database
Install and Configure the Xata CLI
Install the Xata CLI:Network Configuration
Option 1: Public Access (Less Secure)
If your Azure database allows public access:- Configure Firewall Rules:
- Go to “Networking” in the left menu
- Add your IP address to “Firewall rules”
- Or temporarily add
0.0.0.0/0
for migration (remove after)
Option 2: Private Access (Recommended)
For better security, use private endpoints:-
Enable Private Endpoint:
- Go to “Networking” in the left menu
- Enable “Private endpoint connections”
- Configure VNet integration
-
Run Migration from Azure:
- Use Azure VM, App Service, or Azure Functions
- Ensure the service is in the same VNet as your database
Option 3: Azure Database for PostgreSQL Flexible Server
If you’re using Flexible Server:- Configure Network Access:
- Go to “Networking” in the left menu
- Choose “Private access (VNet Integration)” or “Public access”
- Configure firewall rules accordingly
Get Connection String
Azure connection strings typically look like this:Initialize Xata Project
Set up your Xata project configuration:Configure the Migration
Set up your clone configuration with optional anonymization:Start the Migration
Begin the data transfer:Monitor Progress
Check the migration status:Verification
After migration, verify your data:-
Connect to Xata Branch:
-
Check Data Integrity:
- Test Relationships: Verify foreign key relationships work correctly
Next Steps
- Explore Xata branching for development workflows
- Learn about schema changes with zero downtime
- Set up continuous sync for ongoing replication
- Consider deployment options for your Xata instance