2
I am looking for a way to migrate my backup from a Mysql database to Postgresql. The simplest way I found was using sed upon backup, but it hasn’t worked.
It was like this:
1 - performing a backup
2 - executing the command sed "s/\\\'/\'\'/g" bkp-bancodedados.sql
3 - importing the backup in postgresql with the command psql databasename < bkp-bancodedados.sql
However, when trying to import the backup does not work due to syntax errors. I believe that sed is not being executed correctly, or else I should sub-quote, I don’t know. Can someone help me, please?
One of the mistakes is this:
ERROR: syntax error at or near "`"
LINE 1: INSERT INTO `destinatario_mensagem` VALUES (147799,52350,NUL...
replacing the crases with single quotes should work
– Tiago NET
Does this project help you? https://github.com/AnatolyUss/FromMySqlToPostgreSql
– Doug Cunha
I would like something simpler. And what I had found simpler was that sed
– hugofsousa