Description
Merge tool let you overview and selectively apply changes from one database to another.
How to use
- Select Merge tool tab
- Choose both databases. For simplicity sake, you always apply changes from database #2 to database #1
- Review the changes. In detailed view you can see every single change
- Apply the changes you want to apply and save database # 1
Using MergeTool in multi-user environment
If you have more than one developer, who can edit database values in your project, you can use MergeTool to resolve conflicts.
Let's say you changed the database and want to commit the changes to your source control system (Git/Perforce/etc.), however you see that database file was already changed by somebody else. To resolve the conflict in this case, do the following:
- Copy your local database to some folder outside of your project
- Resolve the conflict by replacing your local database with the file from source control system and reload database
- Open MergeTool and for database#2 field uncheck "Use saved default database" and select previously saved file from Step 1
- Review your changes and apply them
- Please, note, in some cases, you need to discuss the changes with your colleague to avoid erasing his/her changes (this could happen if you changed the same row and field). Alternatively, you can use Merge Tool to review the changes your colleague made.
Also, another option for multi-user environment setup is to use Google Sheets spreadsheet with lock sheet as primary source of data.
Alternative workflow for merging data
You can also use JSON-based approach to merge database data
- Create two JSON data sources under "Export/Import" tab, pointing to two different JSON files (let's say "Local" and "Remote")
- Create two corresponding jobs
- Once you noticed a merge conflict- export database data using "Local" data source
- Resolve a conflict by replacing your local database file with the file from source control system and reload database
- Export database data using "Remote" data source
- Merge the difference from your "local" JSON file into "remote" JSON file using text merging program
- Import database data from "remote" JSON file.
- If something went wrong- rollback the changes (by fetching database file from source control and reloading database) and repeat steps 5-7