XF 2.0 Import external resources into Resource Manager

I have a whole lot of external resources (written documents and posts) which I'd like to bring into my XF2 forum as Resources under the Resource Manager. Is there any way I can import them somehow? I'm a programmer, so I'm happy to write scripts and so on to do this, whether by inserting them directly into the database or calling some sort of XF function. Since there are a lot of them, though, I don't want to do each one manually. What's my best course of action here?
 
You could theoretically script it, though there isn't an explicit API to do it, so it would require a fair amount of knowledge of the XF framework. Inserting into the DB isn't exactly viable, especially if you're trying to include files with the resource.

How many are we talking about?
 
How many are we talking about?
Some hundreds, so you can see why I can't do it manually :) I can write some PHP code to do it if need be, if poking data directly into the database is not a good idea, but I don't know what to call to create a resource with known content; is there something I can look at for that?
 
I've made various importers for things like that, doing inserts into the database. So long as you do it on a backup database first, you'll be okay. :) For document files, what kind are you referring to, HTML or something else?
 
For document files, what kind are you referring to, HTML or something else?
They're plain text/HTML docs, mostly, which I want to appear as resources. I can poke them into the DB with some success (into `xf_rm_resource`) but some of the fields in that table are PHP-serialised things (`a:0:{}` and the like) so I'd rather use the proper creation stuff if possible so all that extra stuff gets hooked up, especially since I'll want to add some custom fields. Any advice you have on that is gratefully accepted :)
 
If it were XF 1.x I'd recommend installing the REST API addon and letting it do all the heavy lifting. It might still be worth doing on a test XF 1.5 install, then using XF 2 import to import the resources from XF 1.x. Hard to say, without knowing all the details. Good luck :)
 
Top Bottom