WordPress to NodeBB
-
I installed a fresh WP 4 install, and here's how a fresh DB looks like - i can write an exporter for this, anything non-standard needs its own exporter, unless there is some logical code path we can take for each case, then yea
-
@bentael said:
I installed a fresh WP 4 install, and here's how a fresh DB looks like - i can write an exporter for this, anything non-standard needs its own exporter, unless there is some logical code path we can take for each case, then yea
I'd say that would be the most logical approach. I'm pretty sure the relevant pieces could be extracted from a custom Wordpress install, and placed into a clean one.
-
Hmm, ya that database was part of a multi site install and there are have been used some plugins which added lot more tables. But like a_5mith mentioned, in case of old sites likes these which have modified databases, is not it possible to extract the required ones alone?
Another idea which struck me was, if such databases will need their own exporter, why not, in my case, I transfer the required wordpress database of this site to another simple new install of non multi site wordpress, and then export it to nodebb. Because wordpress to wordpress exporters usually figure all out all type of complicated databases. So do you think such two stage exports will do the trick for multi site or complicated wordpress databases?
Am asking this because, in our case, as you saw, the database has been modified a lot, because we used many plugins, some which I made and some from codecanyon, which introduced some really necessary functions for us.
@bentael -
@vegetagz6 The exporter would just look for the required data, so users, comments, posts, categories and maybe the tags if it's not too difficult. But your database doesn't include the users, so it won't work as is. You will need to convert your multi site db, back to a clean DB. Other tables are ignored, the import plugin only looks for specific table names in the first place. The plugin would work fine for users with a largely modified forum. But it seems that a multi site import is another step entirely.
If I'm not mistaken, I believe wp_users would be on the "master" install of Wordpress, then each subsidiary Wordpress site (wp_1_ , wp_2_ , etc) just contains the information for that wordpress. The user accounts would be verified against the "master database", which leads to an issue when you want to take one of those multi site installs, and import it into NodeBB. You would need to merge the master DB with wp_9_, in a way that didn't cause the loss of any posts, then use the importer.
-
Ok converting multi site back to normal wordpress is easy, that can be done.
But as an ALTERNATE option, won't this plugin work if I exported the required site from a multi site to a normal wordpress installation using wordpress exporter and then go for nodebb export? I think it should work, because a fresh WordPress installation only contains the core tables. So once the users, posts and comments are transferred to a fresh wordpress installation, we can use the nodebb plugin for the final export.
-
@vegetagz6 said:
Ok converting multi site back to normal wordpress is easy, that can be done.
But as an ALTERNATE option, won't this plugin work if I exported the required site from a multi site to a normal wordpress installation using wordpress exporter and then go for nodebb export? I think it should work, because a fresh WordPress installation only contains the core tables. So once the users, posts and comments are transferred to a fresh wordpress installation, we can use the nodebb plugin for the final export.
What I said and what you said were the same thing, so yes. If there's a tool that does it for you, then that would be fine. As long as the final database has all of the tables in this image and they're populated with the right number of entries:
-
I don't even mind handling a "multi-site" WP DB, in one exporter, as long as everything is in a single Database, not multi (that would make it really hairy)
I can add an
advanced-custom-config
that accepts a extra custom JSON for the exporter in the UI, then plumbs it through to the exporter module, so something likeexporterConfig = { dbhost: 'localhost', dbname: 'wp' dbuser: 'user', dbpassword: 'password', tablePrefix: 'wp_', custom: { // anything you want here, // that would be a result of a JSON.parse(/* what's on an advanced UI field */ ) // in the case of the wp exporter, a new custom option is introduced to specify which WP site you want to target // the UI value would be string '{ "wpsite": "1" }' wpsite: "1,2" // that means, site 1 and site 2, // For each Site, the exporter would create a new NodeBB Parent-Category, that's doable too // wpsite: "all", // all sites, you guessed it } }
however, my problem is still the same @vegetagz6,
where are the users?
where are the posts?
is it possible that you might have another database?
-
okay.png,
@vegetagz6 unless you can figure out the answers to my questions, I don't think i can help you much, sorry
anyone else has a standard WP DB with some data?
-
Mentioning previous people that wanted this plugin
-
Ok am sending u a standard database, which has all the standard tables like wp_comments, wp_users etc. Check your pm and lemme know
Ya the previous database was heavily modified, in the sense that it was part of a multisite installation, and belonged to one of the most active site I have.
-
@vegetagz6 no updates yet - maybe next week, sorry ive been very busy combined with very sick for the past 2 weeks.
-
wordpress exporter released,
https://www.npmjs.org/package/nodebb-plugin-import-wordpress@vegetagz6
I only tested against your "dota" db, looks good so far except that you only use 1 out of 2 categories. Your "droid" db had only 2 users..Needs more testing of course,
but can't do much without many DB Dumps,
I also need to export tags for topics but I need more dumps to test with.
-
@John-Smith
@Hawon-Nguyen
@Flexi-Hackify
@Tan-Nguyenread 1 post up
To use it, you just need to install https://github.com/akhoury/nodebb-plugin-import and follow instructions in the Admin plugin page -
@Tan-Nguyen nothing redirects automatically, you have to set something in the middle to redirect. The import plugin will provide a map from old to new.
Read this note: https://github.com/akhoury/nodebb-plugin-import#imported-now-what focus on the redirect section
-
[email protected] now supports importing topic tags - to use it, just use the latest
nodebb-plugin-import
, and select thenodebb-plugin-import-wordpress
from the exporters list (or paste it in the input field) and it will install the latest. As a precaution, uninstall the previous version first
npm uninstall nodebb-plugin-import-wordpress
Right now I query all tags and create a map using the topic ids, I know you don't care, but the impact of this is that if you have millions or maybe hundreds of thousands of tags, depending on your machine, you might run into memory issues
are u a sql guru?
If you are a MySQL guru and can help optimizing the query, try to answer this question.
http://wordpress.stackexchange.com/questions/169863/wordpress-custom-sql-query-get-all-posts-with-category-id-and-a-concated-listif you need to look at the exporter code, it has more fields to select here than the stackexchange question because I wanted to simplify the question as much as possible.
https://github.com/a5mith/nodebb-plugin-import-wordpress/blob/master/index.js#L127-L233 -
even more, now the wordpress gallery shortcodes are supported, with the old post ids, i.e.
[gallery ids="123,456,789"]
shortcodes can be converted to, either,<img>
tags, if you want a gallery plugin, you can then use @psychobunny's nodebb-plugin-gallery, or you can just convert theids
to full URLs which then you can use within your own plugin.read this section for more details
https://github.com/a5mith/nodebb-plugin-import-wordpress#gallery-shortcode-note