CHECKING STATUS
I AM LISTENING TO
|

Website Migration Guide: rsync + MySQL dump + imapsync

16. August 2025
.SHARE

Table of Contents

Overview

This comprehensive guide covers migrating a complete website using three essential tools:

Essential Documentation Links

Pre-Migration Planning

1. Infrastructure Assessment

  • Document current server specifications and configurations
  • Identify all websites, databases, and email accounts
  • Plan DNS change strategy and TTL reduction
  • Set up SSH key authentication between servers
  • Verify sufficient disk space on destination server

2. Downtime Planning

  • Schedule migration during low-traffic periods
  • Coordinate with users about potential email interruptions
  • Plan for incremental transfers to minimize downtime
  • Prepare rollback procedures

3. Security Setup

Reference Links:

File Migration with rsync

Basic rsync Configuration

Standard Website Files Transfer

Advanced rsync Options

Key rsync Flags Explained

Flag
Purpose
-a
Archive mode (preserves permissions, timestamps, symbolic links)
-v
Verbose output
-h
Human-readable file sizes
-z
Compress data during transfer
-c
Skip based on checksum, not mod-time & size
-h
Output numbers in a human-readable format
-e
specify the remote shell to use
--progress, -P
Show transfer progress
--delete
Delete files on destination that don’t exist on source
--exclude
Exclude specific files/directories
--dry-run
Test run without making changes

Performance Optimization

For Servers with Many Small Files

For Large Files

Two-Phase Migration Strategy

Additional Resources:

Database Migration with MySQL dump

InnoDB Databases (Recommended)

MyISAM Databases (Legacy)

Large Database Optimization

MySQL Resources:

Critical mysqldump Options

Option
Purpose
--single-transaction
Creates consistent snapshot for InnoDB
--skip-lock-tables
Prevents table locking
--quick
Retrieves rows one at a time (memory efficient)
--routines
Includes stored procedures and functions
--triggers
Includes triggers
--events
Includes scheduled events
--master-data
Includes binary log position (for replication)

Database Restoration

Large Database Restoration Optimization

Email Migration with imapsync

Basic imapsync Setup

imapsync Resources:

Secure Configuration with Password Files

Advanced imapsync Options

Key imapsync Options

Option
Purpose
--ssl1/--ssl2 or --tls1 --tls2
Use SSL / TLS connections
--delete2
Delete messages on destination not on source
--syncinternaldates
Preserve internal message dates
--idatefromheader
Use date from message headers
--exclude
Skip specific folders
--dry
Perform dry run without changes
--expunge1
Permanently delete messages marked for deletion

Bulk Email Migration Script

Migration Workflow Coordination

Phase 1: Preparation (1-2 days before)

  1. Reduce DNS TTL to 300 seconds
  2. Initial file sync (while site remains live)
  3. Database backup and test restoration
  4. Email account inventory and credential verification
  5. Test imapsync with a few test accounts

DNS Management Resources:

Phase 2: Pre-Migration (Day of migration)

Phase 3: Maintenance Window

Phase 4: Post-Migration Validation

  1. Test website functionality
  2. Verify database connectivity
  3. Test email sending/receiving
  4. Check SSL certificates
  5. Monitor error logs

Troubleshooting Common Issues

rsync Issues

Permission Problems

Connection Issues

Troubleshooting Resources:

Large File Timeouts

MySQL Issues

Large File Import Errors

Memory Issues During Restore

imapsync Issues

SSL Certificate Problems

Authentication Failures

Large Mailbox Handling

Performance Monitoring

System Resource Monitoring

Monitoring Tools:

Migration Progress Tracking

Security Best Practices

SSH Hardening

Database Security

Email Security

  • Use application-specific passwords where available
  • Store passwords in secure files with restricted permissions
  • Delete password files after migration
  • Enable two-factor authentication post-migration

Post-Migration Checklist

Immediate Verification

  • ☐ Website loads correctly on new server
  • ☐ Database connections working
  • ☐ Email sending/receiving functional
  • ☐ SSL certificates valid
  • ☐ Log files show no critical errors

24-Hour Monitoring

  • ☐ Website performance metrics
  • ☐ Database query performance
  • ☐ Email delivery rates
  • ☐ Error log analysis
  • ☐ User feedback collection

1-Week Follow-up

  • ☐ Search engine indexing status
  • ☐ Email deliverability scores
  • ☐ Performance optimization opportunities
  • ☐ Backup verification
  • ☐ Documentation updates

Recovery Procedures

Rollback Plan

Disaster Recovery

  • Maintain backups on original server for 30 days
  • Document all configuration changes
  • Keep migration logs for troubleshooting
  • Test rollback procedures before migration

Advanced Techniques

Using Screen/Tmux for Long Migrations

Session Management:

Parallel Processing

Database Replication Setup

Advanced Migration Techniques:

Conclusion

This migration strategy using rsync, MySQL dump, and imapsync provides a comprehensive approach to website migration. The key to success is thorough planning, incremental transfers, and careful coordination of the maintenance window.

Remember to:

  • Test everything in a staging environment first
  • Have rollback procedures ready
  • Communicate with stakeholders about timelines
  • Monitor the migration closely
  • Validate thoroughly after completion

For additional support, refer to the official documentation:

Additional Resources

Migration Planning Tools

Performance Testing

Server Administration

Security Resources

Backup and Recovery

Let’s Talk!

Looking for a reliable partner to bring your project to the next level? Whether it’s development, design, security, or ongoing support—I’d love to chat and see how I can help.

Get in touch,
and let’s create something amazing together!

RELATED POSTS

This is my own task / project / workflow solution fully integrated into WordPress, which I began developing in 2025. After the recent cloud outages—and following a significant investment in the Asana ecosystem—I decided to build a robust, self-hosted WordPress solution featuring an almost complete Asana Sync API integration. I don’t have plans to make […]

UPDATED: Asana is a great project management tool, but for those who prioritize data privacy, control, and customization, self-hosted alternatives are a better option. In 2026, there are several robust and feature-rich self-hosted project management tools that can effectively replace Asana while giving you full control over your data. Here’s a look at some of […]

Inspired byGutenberg Blocks in Gravity Forms: Seamless Widget IntegrationGutenberg Blocks in Elementor: Seamless Widget IntegrationMeet the Isolated Block Editor – Gutenberg, Untethered – Integrated into Elementor The idea took over Once you start working on an idea its hard not to see all the other possibilities ;) The plugin automatically detects and replaces TinyMCE textareas […]

Alexander

I am a full-stack developer. My expertise include:

  • Server, Network and Hosting Environments
  • Data Modeling / Import / Export
  • Business Logic
  • API Layer / Action layer / MVC
  • User Interfaces
  • User Experience
  • Understand what the customer and the business needs


I have a deep passion for programming, design, and server architecture—each of these fuels my creativity, and I wouldn’t feel complete without them.

With a broad range of interests, I’m always exploring new technologies and expanding my knowledge wherever needed. The tech world evolves rapidly, and I love staying ahead by embracing the latest innovations.

Beyond technology, I value peace and surround myself with like-minded individuals.

I firmly believe in the principle: Help others, and help will find its way back to you when you need it.