PostgreSQL to Tacnode Migration Guide
This guide provides a comprehensive, step-by-step process for migrating your data and applications from PostgreSQL to Tacnode. It covers environment setup, permissions, migration steps, schema adaptation, application refactoring, best practices, and troubleshooting. All content is rewritten in native English for clarity and usability.
Overview
Tacnode supports migration from various PostgreSQL sources, including cloud platforms and self-hosted databases. The process leverages Tacnode's distributed, relational, and semi-structured data capabilities.
Preparation
Environment Requirements
- Source PostgreSQL database (version 9.6 or newer)
- Tacnode database instance (admin access)
- Network connectivity between source and target (preferably private network)
- Data migration tool (Tacnode Data Sync, ETL, or custom scripts)
Permission Setup
Create a dedicated PostgreSQL user for migration:
Create a target user in Tacnode:
Network Configuration
- Ensure Tacnode can reach PostgreSQL (configure firewall/security groups).
- For public access, whitelist IPs and use secure connections.
Migration Steps
1. Create Publication in PostgreSQL
- For all tables:
- Or for selected tables:
2. Set WAL Level
- Set
wal_level = logical
inpostgresql.conf
and restart PostgreSQL.
3. Configure Data Sync
- In Tacnode Data Sync:
- Log in to Tacnode dashboard.
- Go to Data Sync > Data Import.
- Create a new sync task.
- Configure source PostgreSQL connection (host, port, db, user, password).
- Configure target Tacnode connection.
- Select tables to sync.
- Map source to target schemas/tables.
- Set sync mode (full + incremental) and dirty data policy.
4. Start and Monitor Migration
- Start the sync task in Data Sync.
- Monitor progress and status.
5. Validate Data Consistency
- Compare row counts and sample data between source and target:
6. Application Cutover
- Update connection strings:
- Test application features (user registration, product queries, order creation).
Application Refactoring
Update Connection Configuration
Update connection configuration in your app. SQL syntax and feature compatibility is high, but test for:
- Sequence operations:
SELECT nextval('user_id_seq');
- Array operations:
SELECT ARRAY[1,2,3]; SELECT array_append(ARRAY[1,2], 3);
Example Java (Spring Boot) Repository:
Best Practices
Pre-Migration
- Assess data volume, custom functions, extensions, and SQL compatibility.
- Plan migration windows and rollback strategies.
- Train your team on Tacnode.
During Migration
- Migrate non-critical data first, then core business data.
- Monitor migration progress and validate data consistency.
- Document issues and solutions.
Post-Migration
- Optimize indexes and storage post-migration.
- Harden security (IP whitelist, user permissions, audit logs).
Troubleshooting
Publication Creation Errors
- Check user permissions.
Data Sync Delays
- Check WAL settings and replication slots.
Data Type Incompatibility
- Use compatible types (e.g., replace arrays with JSONB, custom types with VARCHAR + CHECK).