[Android General] scherer81:
Finally got it. :)

Based on this thread and combining methods using "WhatsApp Key DB Extractor Master" (WADBEM) and "wforensic" tools I finally got my messages perfectly merged without need to manually delete records on dumped databases.

On Linux, after execute "WhatsAppKeyDBExtract.sh" from WADBEM package on both phones I copied (and renamed it) both 'msgstore.db' files to a "plain" folder on "wforensic" tools subfolder (wforensic/tools) where 'merge.py' script is.

Executing script:

$ sudo ./WhatsAppKeyDBExtract.sh

=========================================================================

= This script will extract the WhatsApp Key file and DB on Android 4.0+ =

= You DO NOT need root for this to work but you DO need Java installed. =

= If your WhatsApp version is greater than 2.11.431 (most likely), then =

= a legacy version will be installed temporarily in order to get backup =

= permissions. You will NOT lose ANY data and your current version will =

= be restored at the end of the extraction process so try not to panic. =

= Script by: TripCode (Greets to all who visit: XDA Developers Forums). =

= Thanks to: dragomerlin for ABE and to Abinash Bishoyi for being cool. =

= ### Version: v4.7 (12/10/2016) ### =

=========================================================================

Please connect your Android device with USB Debugging enabled:

* daemon not running. starting it now on port 5037 *

* daemon started successfully *

Found legacy WhatsApp 2.11.431 in local folder

WhatsApp 2.18.79 installed

Backing up WhatsApp 2.18.79

5106 KB/s (32742805 bytes in 6.261s)

Backup complete

Removing WhatsApp 2.18.79 skipping data

Success

Removal complete

Installing legacy WhatsApp 2.11.431

4589 KB/s (18329558 bytes in 3.900s)

pkg: /data/local/tmp/LegacyWhatsApp.apk

Success

Install complete

Now unlock your device and confirm the backup operation.

Please enter your backup password (leave blank for none) and press Enter:

apps/com.whatsapp/f/key

apps/com.whatsapp/db/msgstore.db

apps/com.whatsapp/db/wa.db

apps/com.whatsapp/db/axolotl.db

apps/com.whatsapp/db/chatsettings.db

Saving whatsapp.cryptkey ...

Saving msgstore.db ...

Saving wa.db ...

Saving axolotl.db ...

Saving chatsettings.db ...

Pushing cipher key to: /sdcard/WhatsApp/Databases/.nomedia

2 KB/s (158 bytes in 0.056s)

Restoring WhatsApp 2.18.79

4342 KB/s (32742805 bytes in 7.362s)

pkg: /data/local/tmp/base.apk

Success

Restore complete

Cleaning up temporary files ...

Done

Operation complete

Please press Enter to quit...

Then copied files:

$ cp extracted/msgstore.db ~/wforensic/tools/plain/msgstore-2018-03-07.db

After executing it again on other phone and copying msgstore.db file:

$ cp extracted/msgstore.db ~/wforensic/tools/plain/msgstore-2018-03-15.db

Then finally merging all databases to one:

$ python merge.py plain/ "msgstore*.db" ./msgstore.db

#######################################

# WhatsApp Msgstore Merge Tool 0.4 #

#------------------------------------#

# Merges WhatsApp message files into #

# a single one. #

# This tool is part of WForensic #

######################################

Origin: plain/msgstore*.db

Output file: ./msgstore.db

+ Merging: plain/msgstore-2018-03-07.db (Merged 0 contacts and 149220 messages)

+ Merging: plain/msgstore-2018-03-15.db (Merged 1 contacts and 11408 messages)

Merged 1 contacts and 160628 messages!

After force stop WhatsApp (clear cache and data too) and copied 'msgstore.db' back to new phone, just opened app and reconfigure account all messages are available.

First run is very slow due to reindexing all chats, media and messages but after it all things going well.

Thanks for all folks!