I have a complex issue to solve, related to database migration. I have a website full of news to migrate that is currently based on a PostgreSQL database and written in PHP, without a CMS. I have a dump of the database that is a huge text .sql file of 300.000+ lines (finished completely with success); the new version of the website should be based on WordPress.

Could you please kindly suggest some best practices of migrating this database dump properly to a MySQL database and importing it afterwards the right way into WordPress, e.g. through PHPMyAdmin? What procedures are to follow so that the database works with the WordPress install so that one can start with the front-end part.

Thank you very much in advance for your help!

  • Good luck. You'll need to convert the PostgreSQL syntax to MySQL syntax, run the converted sql against the MySQL database, then write a series of conversion sql statements to transform the old custom format data into the format used by WordPress. This is a very big job.
    – Hannah Vernon
    Jun 11, 2016 at 14:03
  • Depending on the number of posts in the old system you are likely better off to simply copy-and-paste the posts from the old system to the WordPress system.
    – Hannah Vernon
    Jun 11, 2016 at 14:06
  • @MaxVernon, thank you for your reply! Is there a way to make this conversion (PostgreSQL to MySQL syntax) via the MySQL Workbench? Is there some automated tool for that? It seems that the whole process will be extremely hard to accomplish? A manual post input will require a lot of effort with more than 10.000 posts though... Jun 11, 2016 at 17:38

1 Answer 1


Any specific reason to migrate to MySQL?


Else MySQL Workbench will work. You'll always have to take into consideration any functions/triggers, etc. that might contain advanced pgsql syntax, etc.


As @Max said, good luck!!

  • Hi, the reason for the migration from PostgreSQL to MySQL is that the news website should be based on WordPress as now there is no CMS (pure PHP) and administration is tedious. I will test the plugin you suggested later today and will give feedback. Should I use the .sql dump from the PostgreSQL for that? How should I point to that dump for the wordpress instal to start using it - the usual way via PHPMyAdmin? The installation instructions of the plugin are a bit unclear to me and that is why I am asking. Jun 13, 2016 at 5:28
  • Hello again, guys. I am still wondering how to input the content from the PHP website to the newly installed WordPress - the theme will very soon be styled and the only thin missing would be the articles/posts to be added to the website. I was wondering if there is some best practice web crawling/scraping all the news content with its: - links - article content (text) - author - date - image which goes with every article Can this data somehow be extracted in .XML or .CSV format that can be imported inot WordPress? Appreciate your feedback a lot! Jun 26, 2016 at 10:00

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.