I’m trying to migrate to a managed database, as described in the last section of this tutorial. I apologize, but I’m a bit new to database migration.

When I enter this command:

pgloader mysql://DBUSER:DBPASS@localhost/DBNAME postgresql://doadmin:PASSWORD@stuff.db.ondigitalocean.com:25060/DBNAME?sslmode=require

I get this error:

Failed to connect to pgsql at "stuff.db.ondigitalocean.com" (port 25060) as user "doadmin": SSL verify error: 19 X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN

I’m a little lost here.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers

@webmin Try to add --no-ssl-cert-verification right after pgloader as shown below.

pgloader --no-ssl-cert-verification mysql://DBUSER:DBPASS@localhost/DBNAME postgresql://doadmin:PASSWORD@"stuff.db.ondigitalocean.com:25060/DBNAME?sslmode=require"

Btw I had to wrap the server address of the PostgreSQL server into quotes on macOS. Otherwise I was not able to add the needed sslmode option at the end without triggering an error.

Hey there @webmin,

Have you tried running the following instead:

pgloader mysql://DBUSER:DBPASS@localhost/DBNAME postgresql://doadmin:PASSWORD@stuff.db.ondigitalocean.com:25060/DBNAME

Note the removed ?sslmode=require from the Postgres connection.
The error implies it is trying to force an SSL connection but failing because the SSL certificate that is present is only a self-signed one and not a properly validated one.

Let me know how it goes!
- Matt.