Marty Walker Posted March 17, 2014 Share Posted March 17, 2014 I've got a wee job I will probably need some help with if the client goes ahead with it. I have an XML export of a hosted wordpress.com site (just posts, not pages and they don't let you have an sql file) I need moved into a PW blog tree. I technically know nothing about XML (and I'm not copy/pasting) so I'd appreciate some help with it. Cheers martin [at] smd.net.au Link to comment Share on other sites More sharing options...
teppo Posted March 17, 2014 Share Posted March 17, 2014 There are multiple ways to handle XML in PHP, but for simplest tasks (reading) I prefer SimpleXML. After that it's all about iterating posts in XML and creating matching pages for them via API. Hope this helps a bit. PS. I did notice that you posted this on jobs board, but still wanted to point out that the XML part is really nothing to be worried about. If you're familiar with handling ProcessWire content via API, this should be a piece of cake, unless post data from WP is very complex 3 Link to comment Share on other sites More sharing options...
diogo Posted March 17, 2014 Share Posted March 17, 2014 How complex can it be if it's just posts? You also have the PHP's own XML parser that I find quite easy to work with. Or maybe you can even convert that XML to CSV and use Ryan's module to import it. 1 Link to comment Share on other sites More sharing options...
Nico Knoll Posted March 17, 2014 Share Posted March 17, 2014 I'm currently working on an importer. How fast do you need it? Link to comment Share on other sites More sharing options...
Marty Walker Posted March 17, 2014 Author Share Posted March 17, 2014 Thanks for the SimpleXML pointers. I'll give that a shot. Nico, I haven't got the go ahead yet so I'm in no rush for the moment. Link to comment Share on other sites More sharing options...
Nico Knoll Posted March 17, 2014 Share Posted March 17, 2014 Well I can give you the parser for free: Just put the "wp-import" folder in the same directory as "site" and "wire" and add the name of your xml file in the folders "index.php". --- And if you still prefer a real module you can support development via (for example) PayPal mail@nico.is --- Edit: Forgot to add the attachment wp-import.zip 8 Link to comment Share on other sites More sharing options...
Tyssen Posted May 9, 2014 Share Posted May 9, 2014 Hi Nico, what do you with the output of the parser? Link to comment Share on other sites More sharing options...
adrian Posted May 9, 2014 Share Posted May 9, 2014 Nico - this reminds me (not that I had really forgotten, but have been REALLY busy), that I need to do a little work associated with this for you. I really will try to get to it shortly! Link to comment Share on other sites More sharing options...
horst Posted May 10, 2014 Share Posted May 10, 2014 There is also Ryans explanations with complete code examples here: https://processwire.com/talk/topic/3987-cmscritic-development-case-study/ But this isn't of any help if you only get a XML-dump of the posts Link to comment Share on other sites More sharing options...
Recommended Posts