If you discover that databases are not mapped properly within cPanel after a server transfer using the transfer tool, the mapping database can be rebuild using the following commands:
cp -a /var/cpanel/databases{,.bak}for accounts in $(cut -d":" -f2 /etc/userdomains); do /usr/local/cpanel/scripts/rebuild_dbmap $accounts; done