Table Of Contents
1. Prerequisites for Database Merging
2. Initial Synchronization of Databases
WPvivid Merging plugin allows you to merge only changes(files + database tables) that have been made on a development site to the production site, without losing existing data on your production site.
Prerequisites for Database Merging
There is some preparation work you will need to finish for utilizing database merging.
1. Set Dev Site and Prod Site
Install WPvivid Merging plugin on both your dev site and prod site.
Set the sites as a dev site or a prod site.
2. Connect the Dev site and the Prod site
On the prod site > WPvivid Merging, click ‘Generate a key for creating connection with dev site’ button.
Then copy the key and paste it to the dev site, click Connect to connect the dev site to the prod site.
3. Set A Preview Site (coming soon)
This option is coming soon and will allow you to connect a preview site with the dev site, so before merging data to your prod site, you can safely test the merging and preview changes.
4. Install WPvivid Backup Plugin(it’s free)
It is highly recommended to use WPvivid Backup Plugin to quickly create snapshots for the databases, for example, before you create a database recording task or perform database merging.
So if something goes wrong, you can quickly restore it back to normal.
Initial Synchronization of Databases
Once the preparation work is done, perform the initial synchronization of dev database with the prod database.
1. Clone Prod Site to Dev Site (Files and Database)
Before syncing databases, migrate files of the prod site to the dev site. You can use WPvivid Backup Plugin(it’s free) for the migration. Related Doc: How-to: Transfer Your Site
Or, you can copy the entire prod site (files + database) to the dev site, so you can skip the initial databases synchronization.
2. Sync Dev DB with Prod DB
After the files are copied to the dev site, on the dev site > WPvivid Merging > Click on the ‘Sync Dev DB with Prod DB’ button to start synchronization.
How to Perform Database Merging?
After the dev database is in sync with the prod database, you can start to create a database recording task.
1. What Is A Database Recorder?
A database recorder is automatically created and enabled after you create a database recording task, for keeping track of all changes including files and data queries of the site.
2. What Is A Database Recording Task?
A database recording task contains a full life cycle of a database recording, and allows users to merge all changes (files + data queries) recorded in the task to the prod site.
Thanks to this task system, users don’t have to sync databases every time after a merging which is required with other merging tools, but only do a sync after multiple merging, which saves great time.
A task will be automatically terminated and marked as ‘Merged’ after a successful merging, then a new task can be created as needed.
3. Create A Database Recording Task
To create a database recording task, on the dev site > WPvivid Merging, click on the ‘Create A Database Recording Task’ button.
When creating a task, it is highly recommended to check the option ‘Create a snapshot for dev site’. With it checked, the plugin will create a snapshot for the dev site automatically. Using this option requires WPvivid Backup Plugin(it’s free) installed.
It can take a few minutes to create a task, depending on how many tables and plugins(themes) of the site.
A task will be enabled automatically by default upon creation. So, once a task is created, you will see it running on the Tasks Section.
On this Tasks Section, you can enable/disable a task, view the task start Time, Escaped time(running time), how many database queries have been recorded and how many files have been added, and perform database merging.
You can also rollback the dev site database to a previous point if you have created snapshots with WPvivid Backup Plugin.
Note: The update of task information is not in real time, refresh the page to keep it updated.
4. Merge Changes from Dev Site to Prod Site
When you are ready to merge the changes from the dev site to the prod site, on the dev site > WPvivid Merging > Tasks section > Merge to, select ‘Production Site’ from the drop-down menu.
Choose to merge both Database and Files, Files only, or Database only.
You can also check the option ‘Create a snapshot for your production site before merging’, which is recommended.
After that, click on the ‘Merge Now’ button to start the merging.
Note: Do not close or refresh the page during the merging process, otherwise, the merging will fail and the sites can be down.
The Typical Usage Scenario
At WPvivid, over the past two years, we have been requested by many users to implement the ‘database merging’ feature for a very similar usage scenario, which we think also is the most typical usage scenario for ‘database merging’:
” If I copy my live WooCommerce site, or any other sites where content is updated frequently to a development site, then while I am making design changes to the development site, the live site is also getting new data, i.e. contact form submissions or newly paid membership subscriptions, product updates, etc.
After I am finished editing my development site, copying the development site to live will erase all of the new data that came to the live site.”
It has also inspired and motivated us to develop and launch WPvivid Merging to handle the merging live updates in that scenario.
So now with WPvivid Merging, users can easily keep track of changes that has been made on the staging site, and merge only changes to the production site, without losing existing data on the production site.