Other Moving email to new server

Hi,
I am trying to switch our email server from our old 10.2 server to the new FreeBSD11.1 and I need a few pointer please..
I have ran the following command from our old server to copy the messages: rsync -avz /usr/local/vhosts/ [EMAIL='root@194.12.13.195%3A/usr/local/vhosts/']root@194.12.xxx.xxx:/usr/local/vhosts/[/EMAIL]

So I now have all the email file sync correctly.

In term of databases, I we use 2 databases..
mysql56-server
postgresql93-server


Could you please tell me how to create the database dump for postgresql as I have never used it before.

Also for mysql, will the following command do the job ?
mysqldump -h localhost --all-databases > mail_databases.sql
or do I need more option like
mysqldump --single-transaction --routines --triggers --all-databases > mail_databases.sql
Please advise on the best syntax to use for extracting both mysql and postgresql data.

Thank you in advance
 
Could you please tell me how to create the database dump for postgresql as I have never used it before.
When it comes to dumping all databases then use pkg_dumpall(1), otherwise simply use pg_dump(1). The manualpage explain all the available options. What I use for my Postgres databases is simple: pg_dumpall -af mydump.pgsql. Use the appropriate parameters (-h, -U, -W) to specify the hostname, username and password if needed.

I have a very specific pg_hba.conf which allows me to perform this task as a regular user and without having to use a password.

MySQL is a different story. What I usually use is: mysqldump --opt --all-databases -p > dump.sql. Once again optionally using -h and/or -u to provide either the host and username if needed. Unless your accountname doesn't use a password (not the best of ideas!) you're going to need -p.

For the record: I am aware that the documentation hints at --opt being default, my experiences in the past have shown me otherwise but I don't care about MySQL enough to make sure. So I simply continue to use the option for safety reasons.
 
Back
Top