The Power of Partial Migrations: Syncing Only What You Need

#
By Mike Davey, Senior Editor

Managing WordPress sites across different environments often requires moving data and files. A partial migration involves selectively transferring only specific components of your WordPress installation. Instead of cloning an entire site, you might move just new database entries, an updated theme, or recently added media.

In this article, we look at the intricacies of partial migrations and explore practical scenarios where syncing only what you need can save significant time, prevent workflow disruptions, and streamline deployments.

What Are Partial Migrations?

The traditional approach of moving an entire website, a “full site migration,” involves copying every file and database entry. While necessary for initial deployments or major overhauls, this method can be inefficient and risky for ongoing development.

This is where partial migrations become essential. Instead of an all-encompassing transfer, a partial migration is the selective movement of specific components. This might involve targeting individual database tables, such as the wp_posts table to deploy new articles, or moving only new media uploads, an updated theme, or a single plugin.

The benefits of this granular approach are substantial. First, limiting the scope of the transfer reduces data volume, which translates to faster operations and less server load. Second, partial migrations minimize the risk of inadvertently overwriting critical data or configurations that may have diverged between your environments. This prevents unwanted regressions and simplifies troubleshooting. Finally, it enables truly targeted updates, allowing you to deploy isolated changes confidently, knowing you are only affecting the intended components of your site.

How to Perform Partial Migrations

WP Migrate Lite provides a straightforward interface for executing granular exports. While the subsequent import or file transfer steps are manual, the plugin significantly simplifies the data extraction process. Here, we’ll walk through common partial migration scenarios, detailing how to configure WP Migrate Lite for each.

To begin, ensure WP Migrate Lite is installed and activated on your source WordPress site, and then navigate to Tools > WP Migrate.

Scenario 1: Syncing New Content

This scenario is common when new articles, landing pages, or product entries are developed on a staging site and need to be published to a live production environment without affecting other data.

Navigate to the Export Tab

In your source site’s WordPress admin, access WP Migrate Lite’s interface. From there, select the Migrate tab and then click Export.

The Migrate tab in WP Migrate Lite, showing various options including "Export."

Configure the Export

WP Migrate defaults to a database export, without exporting WordPress core, media files, etc. Leave the “Database” checkbox checked, and then click the Tables dropdown.

In the Tables section, click Export only selected tables below, and then carefully select only the tables relevant to your content. At a minimum, this includes wp_posts (assuming wp_ is your table prefix). If your content utilizes custom fields, you should also select wp_postmeta. For new content involving categories or tags, ensure wp_terms, wp_term_relationships, and wp_term_taxonomy are also chosen. It is important to avoid tables like wp_users, wp_options (unless specific modifications are intended), or unrelated plugin tables to prevent unintended overwrites.

Configure Find and Replace

A crucial step for maintaining correct internal links and asset paths is configuring a Standard Find & Replace function. The “Find” fields should already contain the relevant URL and file paths of your source site. In the “Replace” field, input the URL of your destination site. This ensures internal links or embedded media URLs within your exported content are accurately updated for the live environment, with WP Migrate Lite intelligently handling serialized data.

Once all configurations are set, click Export. WP Migrate Lite will then process the selected tables, execute the find and replace operations, and generate a SQL file.

WP Migrate Lite's Find & Replace function.

Manual Import

After downloading the generated SQL file, the next step is manual import. You will need to access your destination site’s database using a tool such as phpMyAdmin or through a command-line interface like WP-CLI. Import the SQL file into the destination database. Exercise caution if your new content might have conflicting IDs with existing content on the destination site. This method is generally most suitable for importing entirely new content.

Scenario 2: Synchronizing Media Library Additions

When new images, videos, or documents are uploaded to a development or staging environment and need to be moved to production, you can transfer only the new files and their associated database entries.

In your source site’s WP Migrate Lite interface, navigate to the Migrate tab and click Export.

Select Media Files Only

Select Media Uploads. This instructs the plugin to include only the contents of your wp-content/uploads directory in the export package. Within the “Media Uploads” options, you’ll be presented with choices for which files to copy. For synchronizing additions, you will typically choose Export new and updated media uploads. This option intelligently identifies and includes only those media files that have been added or modified since your last sync.

Alternatively, if you need to transfer media uploaded after a specific point in time, you could select Export media uploads by date and provide the exact date. This instructs the plugin to include only the contents of your wp-content/uploads directory in the export package based on your selection.

Configuring media exports in WP Migrate Lite.

Configure Database for Media

In the Database section, choose Export only selected tables below. Media items also have corresponding entries in the database. In the “Post Types” subsection, select Export only post types selected below, and then choose attachment from the list. This ensures that only the database entries specifically related to your media library items (found within wp_posts and wp_postmeta) are exported. You will also want to ensure wp_posts and wp_postmeta tables are selected under the “Tables” section.

Configure Find and Replace

As with content, set up Find and Replace rules to update URLs from your source site to your destination site (e.g., https://staging.example.com to https://www.example.com). This step is vital to ensure media URLs are correctly reflected in the database.

Start the Export

Click Export. This action will generate a ZIP file that contains both the selected media uploads and the accompanying SQL database file.

Manual Transfer and Import

Once the export is complete, download the generated ZIP file. Extract the wp-content/uploads folder from this archive. Using an FTP or SFTP client, manually upload only the new or updated media files and folders to the wp-content/uploads directory on your destination server. Exercise care to avoid inadvertently overwriting existing files unless that is your explicit intention.

Concurrently, import the exported SQL file into your destination database using phpMyAdmin or WP-CLI. This dual action ensures the new media items are both physically present and correctly registered within your WordPress Media Library, making them accessible via the admin interface.

Scenario 3: Deploying a Specific Theme or Plugin Update

Deploying a specific theme or plugin update using a partial migration is particularly useful for custom code or when changes involve database updates, ensuring precise deployment without affecting other site components. When you’ve developed or updated a specific theme or plugin and want to push only those changes, a partial file export is the way to go. This avoids deploying an entire site archive when only one component has changed.

Navigate to the Migrate tab and click Export. In the Files section of the export configuration, select Themes or Plugins, depending on which you want to export,. Then, select only the folder of the theme or plugin you wish to export.

You usually don’t have to include the database as part of this export, unless your theme or plugin update specifically entails database changes that have not been managed separately. If database modifications are necessary, you would combine this file transfer with a corresponding selective database export and import process, as outlined in Scenario 1 or 2.

Finally, click the Export button to generate a ZIP file containing only the selected theme or plugin folder, and any database tables you’ve determined are needed.

Manual Transfer

Download the generated ZIP file, and extract the specific theme or plugin directory from within this archive. Then, utilizing an FTP or SFTP client, manually upload this extracted directory to the corresponding wp-content/themes or wp-content/plugins directory on your destination server. This action will typically overwrite the existing folder. It is always prudent to create a backup of the destination theme/plugin before proceeding.

Elevating Partial Migrations with Greater Capabilities

While WP Migrate Lite provides effective tools for granular exports, its capabilities are confined to the source site. The process of integrating those exports into a destination environment consistently requires manual effort. This reliance on manual download, upload, and import steps—whether for database files via phpMyAdmin or file transfers via FTP—quickly becomes a bottleneck for professional workflows.

This manual overhead significantly reduces efficiency for frequent synchronizations, particularly when dealing with large sites or complex data. It also prevents the automation crucial for modern development pipelines and lacks the direct bidirectional syncing needed to pull fresh data from a live site to a development environment. For occasional, simple exports, WP Migrate Lite is functional, but the limitations of manual processes become apparent when speed, automation, and integrated workflows are required.

When the demands of your workflow exceed the manual capabilities of WP Migrate Lite, WP Migrate offers a comprehensive solution. It transforms partial migrations into a direct, automated process, providing granular control and efficiency.

The core enhancement is its direct push and pull feature, allowing seamless, secure database and file transfers between WordPress sites without manual intermediate steps. This includes precise file synchronization, enabling direct transfer of only new or updated media, themes, or plugins through intelligent comparison of source and destination files. For WordPress Multisite networks, it provides specialized tools that simplify complex tasks like exporting individual subsites or migrating them between networks. Command-line interface integration via WP-CLI allows developers to script partial migrations, integrate them into CI/CD pipelines, and automate routine synchronization tasks.

To further streamline recurring operations, migration profiles can be saved, enabling quick, consistent execution of predefined partial migration settings.

Wrapping Up

A partial migration involves selectively transferring only specific components of your WordPress installation. Instead of cloning an entire site, you can now move just new database entries, an updated theme, or recently added media. This strategic approach to moving data and files is key for managing WordPress sites efficiently across different environments.

While partial migrations have their intricacies, there are scenarios where syncing only what you need can save significant time, prevent workflow disruptions, and streamline deployments. WP Migrate saves even more time by automating the steps you need to do manually when using WP Migrate Lite.

About the Author

Mike Davey Senior Editor

Mike is an editor and writer based in Hamilton, Ontario, with an extensive background in business-to-business communications and marketing. His hobbies include reading, writing, and wrangling his four children.