How do I display news from my old portal with Oracle database to the new mysql database portal in Wordpress

Asked

Viewed 28 times

0

Greetings, my dear friends! I am creating a news portal with Wordpress and MYSQL and would like to retrieve the news from the old portal with ORACLE database. I don’t know, or where to start, to show the new and old news. I’d appreciate it if you could help me.

  • It is easier to migrate to the MySQL or MariaDB. The Wordpress, by default, does not have support for the Oracle, you can even do a gambiarra, but over time maintenance only tends to get worse. That’s not counting the conflicts you will have with some plugins.

  • Great Vladir, does this mean I have no way to retrieve my Oracle data to display in Wordpress? In case I have to migrate the Oracle database to Mysql, what would be the procedure and in which Wordpress file, I would be obliged to alter to be able to display the data?

  • To have, even has. But it is not worth the effort due to the countless problems that you will have in the future. In this reply, a user explains how to do: https://answall.com/a/207721/99718

  • Ok! And in case I want to migrate Oracle to Mysql as I would, dear Valder to work with Wordpress?

  • It will depend on the data structure, the size of the database. As I do not work with Oracle, I can’t tell you the best path to migration, but you can follow this answer: https://dba.stackexchange.com/questions/54413/how-to-migrate-oracle-database-to-mysql-server

  • Okay, Big Valdir. I’ll kill the head so I can.

  • Hello, Grande Valdeir Psr! After studying a little this content en.stackoverflow.com/a/207721/99718, I noticed that it contradicts my purposes. I don’t need to record the posts to the Oracle, but rather recoil them. I mean, I’m creating a new portal and need, in addition to showing the current posts that come from Mysql, I also need to show the old posts I already have in BD Oracle.

  • add_action( 'save_post', 'enviar_dados_pro_oracle', 10, 3 ); Function enviar_dados_pro_oracle( $post_id, $post, $update ) { /* validate here, access permissions, nonces, etc / if ( wp_is_post_revision( $post_id ) ) Return; $Pdo = new PDO(); /* all the rest of your PDO routine here */ } We can tell from the first two lines of code that save_post and update were used. I intend to hook to show the posts, bro. I would appreciate...

  • you can use the pre_get_posts to change the query before the wp capture the posts or you can edit the method get_posts class wp-includes/class-wp-query.php to capture the record in another database. I can add a very basic example, but I already make it clear that it can hurt a little the performance of the site.

  • Thank God I’ve solved this problem, Great Valdeir Prs. Just, I created a tamplate in the root folder of the theme of my site and created a page by selecting my created template. Then I played a little with PHP and Mysql that everything worked. Now, the question is to list the images I have in a directory, but with names stored in the comic book. I’m not succeeding. I list everything but images.

Show 5 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.