GuidesMigration Guides
MySQL to Tacnode Migration Guide
This guide provides a comprehensive, step-by-step process for migrating your data and applications from MySQL to Tacnode. It covers environment setup, permissions, data type mapping, SQL syntax differences, migration steps, application adaptation, best practices, and troubleshooting. All content is rewritten in native English for clarity and usability.
Overview
Tacnode offers distributed, relational, and semi-structured data capabilities. Migrating from MySQL requires careful planning, schema adaptation, and application refactoring.
Preparation
Environment Requirements
- MySQL 5.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 MySQL user for migration:
Create a target user in Tacnode:
Network Configuration
- Ensure Tacnode can reach MySQL (configure firewall/security groups).
- For public access, whitelist IPs and use secure connections.
Data Type Mapping
MySQL Type | Tacnode Type | Notes |
---|---|---|
TINYINT | SMALLINT | Range differs |
BOOL/BOOLEAN | BOOLEAN | TRUE/FALSE |
MEDIUMINT | INTEGER | Use INTEGER |
INT/INTEGER | INTEGER | Compatible |
BIGINT | BIGINT | Compatible |
FLOAT | REAL | Precision may differ |
DOUBLE | DOUBLE PRECISION | Compatible |
DECIMAL(p,s) | NUMERIC(p,s) | Compatible |
DATE | DATE | Compatible |
DATETIME | TIMESTAMP | Tacnode supports time zones |
YEAR | SMALLINT/INTEGER | Use integer |
CHAR/VARCHAR | CHAR/VARCHAR | Compatible |
TEXT types | TEXT | Use TEXT |
BLOB types | BYTEA | Use BYTEA |
ENUM | VARCHAR + CHECK | Use CHECK constraint |
SET | ARRAY or table | Use ARRAY or related table |
JSON | JSONB | Use JSONB |
SQL Syntax Differences
Feature | MySQL Syntax | Tacnode Syntax |
---|---|---|
Identifiers | backticks | "double quotes" |
Strings | 'single quotes' | 'single quotes' |
Pagination | LIMIT offset, count | OFFSET offset LIMIT count |
NULL checks | IS NULL /IS NOT NULL | IS NULL /IS NOT NULL |
String concat | CONCAT() | ` |
GROUP BY | Implicit grouping | Explicit grouping required |
UNION | Implicit type conversion | Explicit type conversion |
Migration Steps
1. Assess and Prepare
- Check MySQL database size and table structures:
- Create databases and users in Tacnode:
2. Schema Migration
- Convert MySQL table definitions to Tacnode:
- Handle ENUM types:
3. Data Migration
- Use Tacnode Data Sync, ETL, or custom scripts to transfer data.
- Validate row counts and sample data:
4. Application Adaptation
- Update connection strings:
- Adjust SQL syntax for pagination, NULL checks, string concatenation, etc.
- Example: Pagination
5. Testing and Validation
- Functional tests:
- Performance tests:
Best Practices
Pre-Migration
- Assess data volume, special types, and application dependencies.
- 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
Data Type Incompatibility
- Use CHECK constraints or application-level validation.
SQL Syntax Differences
- Adapt queries or use ORM frameworks.
Collation/Charset Issues
- Specify collation in Tacnode: