? Migration to ISPConfig

Pre-Migration Checklist

  • ☐ Inventory all websites and domains
  • ☐ List all email accounts
  • ☐ Document database names and users
  • ☐ Note PHP versions and settings
  • ☐ Record DNS records
  • ☐ Backup everything
  • ☐ Plan migration schedule
  • ☐ Notify users of downtime

Migration from cPanel/WHM

  1. Export from cPanel:
    • Create full backup in cPanel
    • Download backup file
    • Extract backup contents
  2. Prepare ISPConfig:
    • Create client account
    • Add websites
    • Create email domains
    • Set up databases
  3. Migrate website files:
    # Extract cPanel backup
    tar -xzf backup.tar.gz
    
    # Copy website files
    rsync -avz homedir/public_html/ /var/www/clients/client1/web1/web/
    
    # Fix permissions
    chown -R web1:client1 /var/www/clients/client1/web1/web/
  4. Migrate databases:
    # Import MySQL databases
    mysql -u root -p c1_database < mysql/database.sql
  5. Migrate emails:
    # Use imapsync for email migration
    imapsync --host1 oldserver.com --user1 user@domain.com \
             --password1 oldpass --host2 newserver.com \
             --user2 user@domain.com --password2 newpass

Migration from Plesk

  1. Backup in Plesk:
    • Create domain backup
    • Include all content and settings
    • Download backup archive
  2. Extract and convert:
    # Extract Plesk backup
    tar -xzf domain.com.tar
    
    # Website files location
    domains/domain.com/httpdocs/
    
    # Database dumps location
    databases/
    
    # Mail directories
    domains/domain.com/mailboxes/
  3. Import to ISPConfig:
    • Create matching structure in ISPConfig
    • Copy files to appropriate directories
    • Import databases
    • Recreate email accounts

Website Files Migration

Using rsync

# Sync files from old server
rsync -avz -e ssh user@oldserver:/path/to/website/ \
      /var/www/clients/client1/web1/web/

# Preserve timestamps and permissions
rsync -avz --preserve-permissions --preserve-times \
      source/ destination/

Using FTP

# Download from old server
wget -m ftp://user:pass@oldserver/public_html/

# Upload to new server
ncftpput -R -v -u ftpuser newserver /web local_files/*

Database Migration

Export from source

# Export single database
mysqldump -h oldserver -u username -p database > database.sql

# Export all databases
mysqldump -h oldserver -u root -p --all-databases > all_databases.sql

# Export with compression
mysqldump -h oldserver -u username -p database | gzip > database.sql.gz

Import to ISPConfig

# Create database in ISPConfig first, then:

# Import single database
mysql -u c1_user -p c1_database < database.sql

# Import compressed
gunzip < database.sql.gz | mysql -u c1_user -p c1_database

# Update database credentials in application
nano /var/www/clients/client1/web1/web/wp-config.php

Email Migration

Using imapsync

# Install imapsync
apt-get install imapsync

# Migrate single account
imapsync --host1 mail.oldserver.com --user1 user@domain.com \
         --password1 "oldpass" --ssl1 \
         --host2 mail.newserver.com --user2 user@domain.com \
         --password2 "newpass" --ssl2

# Batch migration with CSV
while IFS=, read -r email oldpass newpass; do
    imapsync --host1 oldserver --user1 "$email" --password1 "$oldpass" \
             --host2 newserver --user2 "$email" --password2 "$newpass"
done < accounts.csv

DNS Migration

  1. Export DNS records from old server
  2. Create DNS zone in ISPConfig
  3. Add all records:
    • A records for domains
    • MX records for mail
    • TXT records (SPF, DKIM)
    • CNAME records
  4. Lower TTL before migration
  5. Update nameservers at registrar

Application-Specific Migration

WordPress Migration

  1. Export database from old server
  2. Copy all WordPress files
  3. Create database in ISPConfig
  4. Import database
  5. Update wp-config.php with new credentials
  6. Update site URL if changed:
    UPDATE wp_options SET option_value = 'https://newdomain.com' 
    WHERE option_name IN ('siteurl', 'home');

Post-Migration Tasks

  • ☐ Test all websites
  • ☐ Verify email accounts work
  • ☐ Check database connections
  • ☐ Test FTP access
  • ☐ Verify SSL certificates
  • ☐ Update DNS if needed
  • ☐ Monitor error logs
  • ☐ Set up backups
  • ☐ Configure monitoring

Rollback Plan

Always have a rollback plan:

  • Keep old server running for 30 days
  • Document all changes made
  • Have DNS records ready to revert
  • Keep full backups of both servers
Important: Test the migration process with a single website first before migrating all sites. This helps identify and resolve issues early.
Esta resposta foi útil? 0 Utilizadores acharam útil (0 Votos)