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
MySQLorMariaDB. The Wordpress, by default, does not have support for theOracle, 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.– Valdeir Psr
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?
– Constantino
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
– Valdeir Psr
Ok! And in case I want to migrate Oracle to Mysql as I would, dear Valder to work with Wordpress?
– Constantino
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– Valdeir Psr
Okay, Big Valdir. I’ll kill the head so I can.
– Constantino
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.
– Constantino
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...
– Constantino
you can use the pre_get_posts to change the
querybefore thewpcapture the posts or you can edit the methodget_postsclasswp-includes/class-wp-query.phpto 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.– Valdeir Psr
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.
– Constantino