Understanding Content Migration

Two Approaches to CDN

The plugin offers two ways to serve content via CDN:

1. Dynamic Replacement (Default - Recommended)

  • URLs are replaced on-the-fly as pages load
  • Original URLs stay in the database
  • No database changes needed
  • Safe and reversible
  • ✅ This is what the plugin does by default

2. Database Migration (Optional)

  • URLs are permanently changed in the database
  • Hardcoded CDN URLs in posts, pages, and media
  • Slightly faster (no replacement overhead)
  • ⚠️ Harder to reverse if you change CDN providers
Important: Most users don't need database migration. The dynamic replacement is faster, safer, and works perfectly for most use cases.

When to Use Migration

Good Reasons to Migrate

Bad Reasons to Migrate

Before You Migrate

⚠️ Critical Backup Step

BACKUP YOUR DATABASE FIRST!

Migration permanently changes your database. Always create a full database backup before proceeding.

Backup Methods

  1. Via Hosting Control Panel: Most hosts offer phpMyAdmin backup
  2. Via Plugin: Use UpdraftPlus, BackupBuddy, or similar
  3. Via WP-CLI: wp db export backup.sql

Pre-Migration Checklist

How to Migrate Content

Access Migration Page

Go to 1 CDN Manager → Migration

Migration Options

1. Migrate Images

What it does: Replaces image URLs in posts, pages, and custom post types

Affects:

  • Post content (post_content)
  • Image URLs in <img> tags
  • Featured images
  • Gallery images

Example:

Before: https://example.com/wp-content/uploads/image.jpg After: https://img-cdn.example.com/wp-content/uploads/image.jpg

2. Migrate Media Files

What it does: Replaces video and audio URLs

Affects:

  • Video URLs in <video> tags
  • Audio URLs in <audio> tags
  • WordPress media library URLs

Example:

Before: https://example.com/wp-content/uploads/video.mp4 After: https://media-cdn.example.com/wp-content/uploads/video.mp4

3. Migrate Static Assets

What it does: Replaces CSS and JavaScript URLs

Affects:

  • Hardcoded <link> tags
  • Hardcoded <script> tags
  • Inline CSS references

Example:

Before: https://example.com/wp-content/themes/mytheme/style.css After: https://static-cdn.example.com/wp-content/themes/mytheme/style.css

4. Migrate All Content

What it does: Runs all migrations above in one go

Recommended: Use individual migrations first to test

Running Migration

  1. Choose migration type (Images, Media, Static, or All)
  2. Click the "Preview Changes" button (optional but recommended)
  3. Review what will be changed
  4. Click "Run Migration" button
  5. Wait for completion message
  6. Check your site to verify everything works

Migration Progress

During migration, you'll see:

After Migration

Verification Steps

  1. Visit Homepage: Check that everything loads correctly
  2. Check Multiple Pages: Test posts, pages, archives
  3. View Page Source: Right-click → View Source → Search for CDN URLs
  4. Test Media: Verify images, videos load from CDN
  5. Check Admin: Verify media library works

If Something Goes Wrong

Immediate Rollback:

  1. Restore your database backup
  2. Or use the "Rollback Migration" button on Migration page

Rollback Process

The plugin keeps track of migrations. To rollback:

  1. Go to 1 CDN Manager → Migration
  2. Click "View Migration History"
  3. Click "Rollback" next to the migration you want to undo
  4. Wait for completion

Advanced Migration Options

Selective Migration

Migrate only specific post types:

  1. Expand "Advanced Options" section
  2. Select post types: Posts, Pages, Products, etc.
  3. Choose date range (optional)
  4. Run migration

Dry Run Mode

Test migration without making changes:

  1. Enable "Dry Run" checkbox
  2. Run migration
  3. Review what WOULD be changed
  4. Run actual migration once satisfied

Custom Search/Replace

For advanced users with specific needs:

  1. Go to "Custom Migration" tab
  2. Enter custom search pattern
  3. Enter replacement pattern
  4. Select tables to search
  5. Run custom migration

Special Cases

WooCommerce Products

Product images are handled automatically. Migration includes:

Page Builders

Elementor, Divi, Beaver Builder

Multilingual Sites (WPML, Polylang)

Multisite Networks

For WordPress Multisite:

Migration Best Practices

DO's

DON'Ts

Performance Considerations

Troubleshooting Migration

Migration Timed Out

Solution: Increase PHP timeout

Add to wp-config.php: set_time_limit(300); // 5 minutes ini_set('max_execution_time', 300);

Some URLs Not Migrated

Possible causes:

Rollback Not Working

Solution: Restore from database backup

This is why backups are critical!