I want to sync only databases of these two websites and I don't want to change the files.
Before that please read:
Copy or Backup Your Joomla
- You should use JoomlaPack for making a backup from your Joomla Database (not including files). So, you should make a sql file from your A database and save it into your computer.
- Then you should go to cPanel > PhPMyAdmin and Drop all tables within B Database and import A.sql file from your computer.