Recent Topics

1 May 01, 2014 17:35    

Hi,

I want to move from another blog software to b2evolution. Since there is no import plugin for the other software and no general import api for b2evo (as far as I can tell), I have to insert the posts and comments directly into the mysql database. However, the inserted posts do not show up either on the blog itself or on the admin page.

The fields I set in db_items__item are the following:

post_ID, post_creator_user_ID, post_lastedit_user_ID, post_datestart, post_datecreated, post_datemodified, post_last_touched_ts, post_content, post_excerpt, post_excerpt_autogenerated, post_title, post_urltitle, post_main_cat_ID, post_status, post_renderers.

I've checked that post_main_cat_ID is the right id for the blog. What is missing? Do I have to set post_canonical_slug_ID (what is that?)? Do I have to add a relation in another table?

Thanks.

2 May 01, 2014 18:06

Hello @sudavolstviem,

Direct database manipulation (manually) is an error prune process. Just a quick suggestion, I think it's a better idea try to make a XML file with your content (Wordpress export file style) and import it using the WordPress XML Importer feature built-in b2evolution (http://b2evolution.net/man/wordpress-import).

Regards!

3 May 01, 2014 18:59

Hi,

thanks, yes that would be an alternative. Unfortunately wordpress XML files look rather complicated, and there seems to be no official specification. Another possibility would be to create POST requests to the b2evo admin page that simulate submitting new entries. Hm.

4 May 31, 2014 01:02

@sudavolstviem
Were you able to make any progress with auto-posting to your blog? I'm looking for a similar solution. If you'd be interested in collaborating or sharing ideas for how to approach this, contact me via my profile. Maybe together we can brainstorm a solution.

@mgsolipa
I have a few questions regarding the existing utilities for achieving this. You may recall I posted in the Feature Requests forum regarding more detailed 'post by email' functionality.
http://forums.b2evolution.net/feature-request-set-post-date-description-and-keywords
Those requested functionalities would also be useful here. Posts could be prebuilt in a text file or CSV, one post per line. A local crontab would pull the first line of the file, convert it to an email, and send it to the b2evo server, then delete the first line of the file, save it, and repeat the process X hours later.

My questions are in regards to leveraging what already exists in b2evo. If I have premade posts, in plain text file or CSV, it's possible to manipulate that data into a proper wordpress export XML format with regex, sed, awk, etc.

What I'm thinking here is:
1A. Prebuild a series of "posts" as a single TXT file, creating one post per line in XML syntax but saved as TXT
1B. Save this file on a local machine.
1C. Configure a local script to run via cron, every 4 hours on the 0, to strip the first line from the TXT file and save that first line as date-time.XML.
1D. The same script then pushes *XML to the b2evo server via rsync through ssh.

THEN

2. Import the new XML file via b2evo scheduled task every 4 hours on the 10.
3. The post is published

4A. A second local script follows the original script. It runs every 4 hours on the 20 and deletes *XML from the local folder (Since the master post file is TXT, only the recent post XML is deleted.
4B. If necessary, the same script then runs rsync to the b2evo installation again, this time using the --delete switch, which will remove anything on the b2evo server's import directory which doesn't exist in the local directory. Since the local script deleted the just-posted XML file in the previous step, the XML file is no longer in the local directory, so it will be deleted from the b2evo server. (This step may be unnecessary if the import XML function in b2evo deletes the XML after the post is created. I wasn't sure if it does, so I added this step).

What do you think? Yes, it's a roundabout way of doing things, but if b2evo's XML import can be triggered by scheduled task, then it should work, and would create a new post every 4 hours until the TXT file is exhausted.

So:
1. Can you post a sample wordpress export XML which is completely compatible with b2evo, and which contains a "sample" post content, so that we can take a look at the structure of it?
2. Does the wordpress export XML to b2evo import support categories, keywords, tags, excerpt, backdated post time, etc, or does everything get imported/posted to a single b2evo category without any tags or keywords and using the current time?
3. Can the import function itself be automated? (i.e. bypass the manual backend steps and trigger the import by crontab or scheduled task instead? If so, is there a way to specify "replace vs append" when doing so?)
4. Does the XML import delete the XML file after the post is created, or does it leave it on the server?
5. Can XML files be imported in-bulk, and can their dates / times be backdated in the XML file?

jj.

5 May 31, 2014 12:42

@jibberjab it's nice to see an enthusiast like you :D

Let me try to answer this step by step with the things that I know and maybe with a couple of questions.

I have a few questions regarding the existing utilities for achieving this. You may recall I posted in the Feature Requests forum regarding more detailed 'post by email' functionality.
http://forums.b2evolution.net/feature-request-set-post-date-description-and-keywords
Those requested functionalities would also be useful here. Posts could be prebuilt in a text file or CSV, one post per line. A local crontab would pull the first line of the file, convert it to an email, and send it to the b2evo server, then delete the first line of the file, save it, and repeat the process X hours later.

My questions are in regards to leveraging what already exists in b2evo. If I have premade posts, in plain text file or CSV, it's possible to manipulate that data into a proper wordpress export XML format with regex, sed, awk, etc.

Your suggestions about email posting improvements are under discussion, actually I put my +1 in a common framework to let us do the main thing that you're describing here: import posts from CSV files, but as a direct process instead of using the email as a gateway. However, it may take a long time even to start with the development, then test it extensively and finally release it. I found a WordPress plugin that imports (they say) posts in CSV format, it's available in their site and you can find it by your own. So if you are able to backport it to b2evo (or ask a pro to make it for you) and then share it with us under the spirit of the free software movement, it would be a nice touch!

Now, I read your detailed process and only got a question: why are you trying to design a deferred posting sequence? If you need your content to be published in a periodical basis and you already have the posts in a file, just make a single import and set the time control using the date issued field. I mean, you may upload zillions of posts with different issue date values and they will be available only starting from their own date/time. I'm telling you this only to make sure that you know this feature before to spend time designing anything more complex (http://b2evolution.net/man/issue_date), if you already knew it and still want to keep on that way, excellent, we are open to talk about it here.

6 May 31, 2014 12:43

Can you post a sample wordpress export XML which is completely compatible with b2evo, and which contains a "sample" post content, so that we can take a look at the structure of it?

It's pretty easy to test it. WP has its own export tool and those files are 100% compatible with the b2evo's importer. I used a plugin to generate random content and then export the attached file. I also tested and the import runs flawless.

2. Does the wordpress export XML to b2evo import support categories, keywords, tags, excerpt, backdated post time, etc, or does everything get imported/posted to a single b2evo category without any tags or keywords and using the current time?

The best way to answer that is encouraging you to test it by yourself, but yes, all that is imported correctly, even the users that make posts or comments could be imported as well.

3. Can the import function itself be automated? (i.e. bypass the manual backend steps and trigger the import by crontab or scheduled task instead? If so, is there a way to specify "replace vs append" when doing so?)

As well as I said on CVS import, it is not possible in our standard release but it would be nice to have a plugin to do that http://plugins.b2evolution.net

4. Does the XML import delete the XML file after the post is created, or does it leave it on the server?

No, it doesn't. Here is some documentation about the process: http://b2evolution.net/man/wordpress-import. After the import, all the files uploaded to the folder blogs/media/import remain there.

5. Can XML files be imported in-bulk, and can their dates / times be backdated in the XML file?

No, there is no bulk routine for import. The dates subject was addressed above.

8 May 31, 2014 21:59

@mgsolipa
Thanks for the reply.. I may be unclear as to the functions that are available with the bulk import.. You said:

just make a single import and set the time control using the date issued field

Let's say I have a text file which contains 2500 posts in it. Each of those posts needs to be published at a different time, into a different category and subcategory, using different keywords, description, and excerpt. I was under the impression that the "Mass Create" function allows only title, content, and separated with a blank line.

Can I specify, in the bulk import file, each of those things in separate lines? Or do I need to bulk import / Mass Create and then manually edit all 2500 posts with their own release date, time, keywords, description, categories, etc etc...? If I can specify all of those things, in advance in the Mass Import file then, yes, the bulk import will work. But if I need to afterwards manually set those settings for 2500 posts individually then that's just not feasible..

I've seen the WP plugin you refer to.. It is able, apparently, to do all of those things and more.. It's actually made me seriously consider doing this project using WP because it could be fully automated.. I could import a CSV with pre-defined date/times, and they would essentially sit in a queue until they were all posted over the next year or so... (It's not a good idea SEO-wise to have a site go from a dozen posts to 2500 posts overnight, so I need to space them approx every 3-4 hours).

jj.

9 May 31, 2014 23:02

@jibberjab well, maybe we are mixing up some things. In my previous reply I was talking about the XML Importer or an hipothetical CSV Importer plugin, actually, if this were my project, I would discard email post and Mass create, I just see them more complex.

If you already have all that information (release date, time, keywords, description, categories, etc etc) well structured in the CSV file, no matter if there are 1 or 2500 posts, the only thing that you need right now to make it work with b2evo is: 1) a CSV importer plugin, or 2) a XML file with WP format to be imported to b2evo using the XML Importer (http://b2evolution.net/man/wordpress-import). So, if the idea I gave you about to backport the WP plugin and share it with us didn't like you ;) you could do the following:

1) Import the CSV file in a WP site
2) Use the WP standard tool to export the site and get the XML file.
3) Come back to b2evolution - the Ultimate Social CMS for your website(s) and import the XML, as described in the manual page I linked above :D

10 Jun 01, 2014 00:03

Ah, ok.. yes we were talking about two different things.. Hmm.. I have been thinking of installing a testing copy of WP. I could use the same installation to import the CSV using that plugin and then export it back out.

So instead of *back dating* the posts I would actually need to forward-date them so they post in the future.. otherwise they'll all post immediately as soon as the XML is imported into b2evo. The problem there is figuring out a way to forward date them en masse and within a specified range.. The CSV contains dates across a 5-6 year span.. that would need to be condensed down to a 1 year span or the auto-posting will be going for the next 6 years, lol. Not sure yet how to do that, unless I simply do a find/replace.. find every instance of 2013, 2012, 2011, 2010, 2009, and 2008 in the CSV and change them all to 2014.. That could create out-of-order posts though when Post X from May 01 2009 is changed to May 01 2014 and Post Y from February 01 2010 (after Post X) gets changed to February 01 2014 (before Post X). Time for some brainstorming.

Backporting the plugin.. it's not that I don't like it.. it's that aside from being an out of the box kind of thinker, I'm primarily a front-end designer / graphic artist.. not so much a programmer :)

jj.

11 Jun 01, 2014 00:14

Actually, if I pre-sort the entire CSV chronologically, so alphabetical order is no longer the sort order, and *then* change all the dates to 2014, that should work.. provided that Libre Calc allows subsorting on year AND month and not just year. I might be overlooking something, but I think that should work.. Can't quite get my head around it yet.

A follow-up question.. with blogs in general, do back-dated posts get picked up by the ping services..? In other words, if I create a post right now, in any blog software, not specifically b2evo, and I backdate that post to 2008.. will it ping out? Or is there a back-date time-limit so only current posts ping?

jj.


Form is loading...