Yeah that wasn't a good idea.
The Calibre folders should be considered a black box. Don't touch them, let Calibre handle them.
The proper way to merge libraries is to open the second library with Calibre and use the "copy to library" option to copy the books to your main library.
If you have backups, restore to them. If not...well you've got a bit of a mess to sort out.