I'm looking for a way to migrate my backup from a MySQL database to Postgresql. The simplest way I found was by using sed on top of the backup, but it did not work.
It was as follows:
1 - Performing a backup
2 - Running the command sed "s/\\'/\'\'/g" bkp-bancodedados.sql
3 - importing the backup into postgresql with the command psql databasename < bkp-bancodedados.sql
But when trying to import the backup does not work, due to syntax errors. I believe that the sed is not running properly, or else I should replace the quotes, I do not know. Can someone help me, please?
One of the errors is as follows:
ERROR: syntax error at or near "'"
LINE 1: INSERT INTO 'destinatario_mensagem' VALUES (147799,52350,NUL...