One way to move from MySQL/MariaDB to PostgreSQL is to use Federico Campoli's tool, called pg_chameleon, which can be downloaded for free from GitHub: https://github.com/the4thdoctor/pg_chameleon. It has been explicitly designed to replicate data to PostgreSQL and does a lot of work, such as converting the schema for you.
Basically, the tool performs the following four steps:
- pg_chameleon reads the schema and data from MySQL and creates a schema in PostgreSQL.
- Stores MySQL's master connection information in PostgreSQL.
- Creates primary keys and indices in PostgreSQL.
- Replicates from MySQL/MariaDB to PostgreSQL.
The pg_chameleon tool provides basic support for DDLs such as CREATE, DROP, ALTER TABLE, and DROP PRIMARY KEY ...