Extract posts from Drupal - php

I have a website (for which I don't have access but I have the database and the website on my local drive) that was made in Drupal and which I need to update. Since I have no experience working in Drupal, I decided to do a new website in PHP (Laravel) but I have to add the posts that are already in the Drupal website. There are sections in the website of which each has it's own posts.
I found where the posts are in the Drupal database, in the node and node_revisions table. But the problem is that I can't find a way to figure out which post is in which section. Hoe does Drupal differentiate these posts?

I recommend looking into drush node export. It might save you some time. You can export all nodes to a xml file.

"sections" probably is another node field where is stored node category.
Try to search for any of the "section" value in DB. Then you will see relation with nid from node table.

Related

Migrating Large PHP Website to Wordpress

I used to have a Wordpress website a few years ago. After getting hacked, I decided to create my own PHP script and extract the necessary data from my Wordpress Installation and keep the same URL structure. Now, a few years later, I want to move back to Wordpress for various reasons. My site has over 2500 articles, and manually importing these articles will be a pain, and I want to keep the same URL structure, as to not lose any SEO.
Here is my SEO structure
https://www.example.com/post-id/post-title-all-lower-case/
I have a database with the following values:
post id
post url (the url slug)
category id
post title
post content
etc..
I can easily create an xml or rss feed with these values for the 2500 posts. But I don't know how to import this content to wordpress. Anyone got any ideas on how I can go through a smooth transition?
I just need this content imported. Creating the theme and everything else is the easy part.
All help is greatly appreciated!
EDIT: SOME PROGRESS!
I have uploaded all my content to a new wordpress installation. Each post has a custom field with a unique number. This number MUST be the post_id.
How do I make it so that I make this custom field the post_id of that post?
All help is greatly appreciated!
You can use this wordpress plugin for safe migration.
https://wordpress.org/plugins/duplicator/
I did something like this a couple of years ago, using MS Excel to concatenate the cells to export to a csv file we could load directly to the mysql db using PHPMyAdmin. We were also doing categories, which involved various tables. For posts, I think you can load directly to the wp_posts db table. I'd create a single post in WP, look to see what table counts change. The look at the tables that changed to see how you would need to populate a csv file to load your content.

Implement Custom Search Plugin for Joomla

I would like to implement a Custom Search Plugin for Joomla 3.5.1. I am new to Joomla and still busy getting my feet together.
I recently implemented a plugin that adds custom/extra fields (5 fields, free text inputs) to an article in Joomla 3.5.1. I followed their tutorial on how to get this right and so far so good. This plugin saves the extra/custom fields in the #__user_profiles table as per their tutorial. I could obviously save it to a different table but since I am learning, I kept it simple. This plugin works perfectly and I can capture the extra fields and saves successfully and the data is saved along with the article id being edited/created.
My next task is to create another site/front-end "search" (or smart search) plugin. This plugin must group the 4 field's values and provide them to the user in the front-end as selects/dropdowns.
Is there someone that can give me a lead on how I can archive this. Must I implement it as a search or smart search plugin? Is it even possible to archive what I am trying to archive?
This search plugin will only appear on one page but that I know I can config correctly once I've a plugin. Once user searches, the system must post back the selected options and I will search the "#__user_profiles" for any matching profile_key vs profile_value and collect all user_id (article_id) and get these articles from contents table and return this list of articles to the front-end as search results. Anyone can help me into the right direction?
I tried their tutorial of creating a search plugin but I seem lost, mostly I don't know how to dynamically provide my selects/dropdowns with that info saved in the #__user_profiles table.
Please assist in anyway possible...
I don't think that this might be done without modifying core 'search' task. My advise is to advise search view and include extra filtering, then write own 'search' task which allow you to read this data and provide additional results.
By writing just search plugin you can only extend search results by data which is stored outside default Joomla! tables but nothing more.

populate Wordpress page/post from external db - on the fly

After providing an event calender with PHP/MySQL/HTML/CSS I want to use Wordpress for that project from now on. Account and data management will remain outside of wordpress scope.
My best idea so far is to populate the posts (or pages) entirely from the already existing db. The URLs would be created by apache's rewrite engine.
To use one post and populate just the content would lead to really bad SEO.
So I want to create (virtually) unique posts populated entirely from the db. Extensive research on that topic brought up nothing usable so far. Maybe someone could point me in the right direction?
Preferences:
using mod rewrite to create the pages urls from event /ID/title rather than using the timestamps to create posts
keeping the data editable via external admin panel (no copying into WP-DB)
head data of post / page must be populated from db, e.g. title, author, timestamp etc.
Suggestions would be much appreciated, thanks in advance.
Have you tried the plugin WP All import. It creates unique post such are car listing etc based on the external DB. I also allows you to style and format your post.
https://wordpress.org/plugins/wp-all-import/

Wordpress plugin to automate posts being generated based on backend tables?

I am a long time Wordpress user looking to use the tool as a CMS to generate a website which will have individual posts about hundreds of specs on products that I have stored in a backend MySQL table. Is there a plugin or a tool that will help me auto generate these posts? For each post, I would like it to have the same format of title (one column) so that the URL will look like: http://www.domain.com/product1specs etc. Each post will contain a description (another column) and show a graph (data stored in another column).
Or do I even need to create posts? Is there a way to do this dynamically? So if someone goes to www.domain.com/product1 than it will automatically look in the database to find out what it should display for product1?
I believe there are other ways to do this with an PHP framework such as Code Igniter but I would like to stick with Wordpress because I am familiar with it and have other Wordpress plugins/themes I would like to leverage.
Any tips would be greatly appreciated!
I don't know of a plugin but take a look at this answer which basically required the same thing:
How to migrate from Yii to Woocommerce Wp, Still keep to old database (table,rows)

How to create a field on a node in drupal?

Im using drupal and just want to create a field on a node for users to submit a number.
Ive created a module. Through the install file ive created a table in mysql and added uid, nid, and amount columns.
Now I just want a field on the node page, node/%. Not on the node/%/edit pages.
So users viewing the node can specify the value then the nid, uid and amount will be sent.
Ive tried hook form alter and hook node api. But all the tutorials i can find are for changing field values, or adding fields to the edit page.
Thanks for any help or any starting points
This sounds like you would be best to look at the voting_api module or user_points modules. If those use cases don't fit your needs, they would be a starting point to see how to do what you want.
I cam across this post this morning and seems this might also give you a little help with attaching a form to a node content page.
Working with forms in Drupal 7

Categories