Data dump from an external SQL database onto a current Plone site

Does anyone know if it be possible to do a database dump from an SQL database into Plone? If so, are their add-ons or tools to enable such a process? A particular field in a Dexterity content type needs to pull information from an SQL database. Is this even possible? Any help or advice would be most appreciated. Thank you.

What would you want to do with a database dump in Plone?.

Very few people will need support for this. Thus, I doubt that this use case will be supported by tools/add-ons.

If your Plone runs on the same host as the database, there is a chance: in a view (specially protected) you can use database command line tools (called via os.system or functions from the subprocess module) to produce a dump. You then use Plone commands to put the file into Plone.

Note, however, that databases usually contain sensible data. Therefore, special security applies for the creation of dumps. You must take action to overcome those security measures (which are less related to Plone but to the database and your system). If your database contains sensible data, you must take steps to protect access to a database dump loaded into Plone.

Thanks so much for your advice. Unfortunately, the database will not be on the same host which adds to the complication. So I will most probably stay away from this. It is not worth the risk and effort to do something that is so out of the ordinary. I will recommend another solution to my people. Thanks again. You have been very helpful. Cheers! :grinning:

Not sure what your particular usecase is. But if your data from the database is static and does not change then you can export the related data from the RDBMS some how and turn it into Python code or a text file or whatever and consume it inside Plone as a vocabulary...we have some installations where static information is maintained as a CSV, Excel or text file (customer updates the data on its own) and we consume the data as a Plone vocabulary.

1 Like

I have recently used example.trajectory to learn more about maniplulating SQL data with Plone.

Slideshow and video from PloneConf 2016: https://2016.ploneconf.org/talks/integrating-sql-data-into-your-plone-site

Thank you so much Norbert! This is very helpful! Cheers!