How to Synchronize WordPress Live and Development Databases

How-to-Synchronize-WordPress-Live-and-Development-Databases

As a web developer, using real content is considerably easier when developing WordPress themes. However, in the process you will encounter some unexpected situations, especially when adding pages, posts, media and comments. Hence, the only way to improve your workflow is by automatically synchronizing your content.

Synchronization Snags

You may think that database replication can be more challenging than you expect. But, you can learn from several reasons why few coders can survive in this dreamland.

Data Differences

There are various configuration settings in WordPress database. Some of them are the domain name and paths which are used throughout posts and asset references. To avoid any undesired consequences, do not import this information into a local database. Even though, the image and link URLs seems like working but it could take you back to the live server. To add to the complications, WordPress serializes some data. It can be difficult to parse and change those values.

Multiple Installations

If you are working alone on a local installation and uploading to a single live server, synchronization becomes less necessary and complicated compare to working with teams with multiple developers, staging servers, or more than one production server.

Databases can be Large

You’re unlikely to want or need numerous megabytes of post data, even if fast incremental synchronization were implemented.

It’s Not Just Databases

In the local file system, WordPress stores uploaded images and other media. Those need to be downloaded and the database references must be updated accordingly. Besides, you also need to make sure that theme and plugin files are synchronized, enabled, and configured appropriately. This will help avoiding certain plugins, e.g. multi-site, caching, etc enabled.

Is Synchronization Possible?

It will be difficult to find one option that can fit to all sizes as it will depend on your circumstances. For instance, you may want one-way replication from live to development servers. However, you can choose one among so many options below:

WP Migrate DB Pro

Many people find that the WP Migrate Pro WordPress plugin is the best-known and easiest choice from Delicious Brains. It is available in a free edition.

WP Sync DB

WP Sync DB is an open-source fork of WP Migrate DB.

VersionPress

VersionPress is able to manage database merging. It is a Git-based version control plugin for WordPress. This product seems promising even though it is in development process.

WPSiteSync for Content

WPSiteSync permits real-time synchronization of pages, posts and other data. It is also offering free and commercial editions.

Database Sync

Even though, Database Sync is not compatible with multi-site installations but it may be enough for some developers.

WordPress Importer

WordPress Importer is suitable for those who prefer a safer, more manual process, exports posts, pages, comments, categories, tags, authors and other data to an XML file that can be imported into another installation.

SyncDB

SyncDB is a bash script. It synchronizes local and remote WordPress databases.

WP Staging

The WordPress WP Staging plugin can clone data and files from live to development or staging servers.

WordPress GitHub Sync

The WordPress GitHub Sync plugin allows you to synchronize content allows you synchronize content from a GitHub repository or Jekyll-created website.