1

I have a backup file which I obtained using pg_dump command in linux mint. I want to restore this database file into a mysql database. I am using dbeaver tool. The command I used to get the database backup was this.

pg_dump -h localhost -p 5432 -U postgres -F c -b -v -f "/home/james/BACKUPFILE.bak" DB_NAME

I am able to restore this backupfile into another postgres database fine but I need to restore the same into a mysql database.

Command I am using to restore the backup into postgres database is

pg_restore -h localhost -p 5432 -U postgres -d DB_NAME_NEW -v "/home/james/BACKUPFILE.bak"

Hope someone can help

1 Answer 1

4

You cannot simply pg_dump from a Postgres database and expect to be able to load it into a MySQL database, since there are syntactical differences between the two database engines, along with some differences in structure/organization (e.g., storage engines). In order to perform this task, you'll need to use a third-party migration tool (seems that pg2mysql is a pretty well-known one).

Otherwise, you can try using DBeaver's Export Data function and see if you can map columns/tables (or create tables) as desired.

Disclosure: I work for EnterpriseDB (EDB)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.