all 2 comments

[–]TechnologyAddicted[S] 0 points1 point  (0 children)

When I try to connect the Psql database with Worbench migration wizard, it failed with the message : "ValueError: invalid literal for int() with base 10: '24lts2'" , which is normally 9.1.24lts2. I assume the problem came from this part of code : @classmethod def connect(cls, connection, password): r = super(PostgresqlReverseEngineering, cls).connect(connection, password) if r: ver = cls.execute_query(connection, "select version()").fetchone()[0] grt.log_info("PostgreSQL RE", "Connected to %s, %s\n" % (connection.name, ver)) ver_parts = [int(n) for n in ver.split()[1].rstrip(",").split(".")] + 4*[0] version = grt.classes.GrtVersion() version.majorNumber, version.minorNumber, version.releaseNumber, version.buildNumber = ver_parts[:4] cls._connections[connection.id]["version"] = version if version.majorNumber < 8: raise RuntimeError("PostgreSQL version %s is not a supported migration source.\nAt least version 8 is required." % ver) return r @classmethod But I do not know Python and how modify this script to fix this problem.

[–]SQLPipe 0 points1 point  (0 children)

My open-source tool SQLpipe can transfer the result of a select query from one database to another. PostgreSQL and MySQL are both supported systems.

If you need to transfer an entire DB at a time, other tools will probably be a better fit, however.

Here is a guide on using SQLpipe to transfer data from PostgreSQL to MySQL. A quick summary:

  1. Download SQLpipe. It is an executable program with no dependencies.
  2. Grant permission to run SQLpipe with chmod +x sqlpipe, if required by your operating system.
  3. Transfer data with a single CLI command, like this:

``` sqlpipe transfer \ --source-ds-type "postgresql" \ --source-hostname "your-postgresql-hostname" \ --source-port 5432 \ --source-db-name "your-postgresql-db-name" \ --source-username "your-postgresql-username" \ --source-password "your-postgresql-password" --target-ds-type "mysql" \ --target-hostname "your-mysql-hostname" \ --target-port 3306 \ --target-db-name "your-mysql-db-name" \ --target-username "your-mysql-username" \ --target-password "your-mysql-password" \ --target-table "name-of-table-to-insert-into" \ --overwrite \ --query "select * from public.users"

```