I'm trying to migrate one database from server A to server B.

The database is mysql. This database has some records with character like ç, ã é, ...

The database encoding is UTF8

So on **server A** I export like this

```
mysqldump -u root -p sis > sis3.sql  

```

Then I open the file (with `vi`) and the characters are not OK.
So I tried

```
 mysqldump -u root -p sis --default-character-set=utf8 > sis3.sql 

```

Not OK yet. Then

```
 mysqldump -u root -p sis --default-character-set=latin1 > sis3.sql 

```

And now the file *seems* OK.

### The copy

The copy to server B is made from server B using

```
scp -i p root@0.0.0.0:/home2/sis3.sql ~/

```

But whenever charset I copy to server B, the file is never OK. the "special" characters are always wrong.

I tried to import on three ways (latin1, utf8, no default), all go wrong.

I import this way:

```
mysql -u root -p"pwdpwdpwd" --default-character-set=utf8 sis < sis3.sql 

```

Of course, changing the default character set.

**But, as before I import to mysql the file is already "damaged", I think this probably caused over ssh transfer.**

Is there a way to transfer the mysql database without this problem?

Servers Info
------------

### Server A

```
Linux version 2.6.32-5-amd64 (Debian 2.6.32-48squeeze6) (jmm@debian.org) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Tue May 13 16:34:35 UTC 2014
# locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=pt_BR.UTF-8
LC_TIME=pt_BR.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=pt_BR.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=pt_BR.UTF-8
LC_NAME=pt_BR.UTF-8
LC_ADDRESS=pt_BR.UTF-8
LC_TELEPHONE=pt_BR.UTF-8
LC_MEASUREMENT=pt_BR.UTF-8
LC_IDENTIFICATION=pt_BR.UTF-8
LC_ALL=

```

### Server B

```
Linux version 4.4.0-0.bpo.1-amd64 (debian-kernel@lists.debian.org) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 SMP Debian 4.4.6-1~bpo8+1 (2016-03-20)
# locale
LANG=pt_BR.UTF-8
LANGUAGE=
LC_CTYPE="pt_BR.UTF-8"
LC_NUMERIC=pt_BR.UTF-8
LC_TIME=pt_BR.UTF-8
LC_COLLATE="pt_BR.UTF-8"
LC_MONETARY=pt_BR.UTF-8
LC_MESSAGES="pt_BR.UTF-8"
LC_PAPER=pt_BR.UTF-8
LC_NAME=pt_BR.UTF-8
LC_ADDRESS=pt_BR.UTF-8
LC_TELEPHONE=pt_BR.UTF-8
LC_MEASUREMENT=pt_BR.UTF-8
LC_IDENTIFICATION=pt_BR.UTF-8
LC_ALL=

```