In order to restore a MySQL database to another database, use routines and triggers.
<pre lang="bash">
mysqldump -p user -p --routines --triggers db1 > db1.sql
To restore to another database, just use the normal command.
<pre lang="bash">
mysql -u user -p db2