Export / import WordPress database

I normally use mysqldump and sed:

on old server:

mysqldump -u user -p OldWpdatabase > wpdb.sql

sed -i 's/oldurl/newurl/g' wpdb.sql

on new server:

mysql -u user -p NewWpdatabase < wpdb.sql

sed is used to search and replace all the hard coded occurrences of the website if needed.