2

I have a website I started to build couple years ago. But the website itself grew up to something bigger, with more fields and details - and old data are missing these. E.g., recently added Long./Lat. fields but old content doesn’t have them. So I wonder if it’s possible (and what module) to export all data into csv file, update it (I think it's much easier than open one by one node) and than import the updated data? Or something like that.

Thanks for any help.

1
  • How about Data Export Import? I found interesting comment about it here drupal.stackexchange.com/questions/41003/…. "What I like about data_export_import is that it is an all-in-one module (for export AND import of data. Whereas as with some other solutions, the import and export stages are done by separate modules, which could mean that extra work is needed ensuring compatibility of the export with the import.)"
    – Afan
    Commented Apr 28, 2015 at 22:05

3 Answers 3

1

If you want to do it that way, use Views data export. Here is an excerpt about it from the module's project page:

... designed to provide a way to export large amounts of data from views. It provides a display plugin that can rendered progressively in a batch. Style plugins are included that support exporting in the following types:

  • CSV.
  • Microsoft XLS.
  • Microsoft DOC.
  • Basic TXT.
  • XML.

Then, re-import using the Feeds module. Here is an excerpt about it from the module's project page:

Import or aggregate data as nodes, users, taxonomy terms or simple database records.

  • One-off imports and periodic aggregation of content
  • Import or aggregate RSS/Atom feeds
  • Import or aggregate CSV files
  • Import or aggregate OPML files
  • PubSubHubbub support
  • Create nodes, users, taxonomy terms or simple database records from import
  • Extensible to import any other kind of content
  • Granular mapping of input elements to Drupal content elements
  • Exportable configurations
  • Batched import for large files
2
  • I'm already playin' with Views Datga Export but wondering (of course I'll test it by myself but if you already tried this...) do I need to export ALL fields of the content type and then import them all again once they are updated, or I can export just some of them, like nid, title and "problematic" fields (e.g. long/lat), update them and then import only these? Would I delete e.g. Body if I not import it again?
    – Afan
    Commented Apr 28, 2015 at 21:51
  • No, you do not need all fields. You will need to export at least one field to use as the unique identifier. Feeds does not modify fields that are not mapped in the import. Commented Apr 29, 2015 at 18:57
0

The feeds module, as suggested by RoloDMonkey seems indeed the way to go for re-importing updated data.

However, to export the data, you may want to consider the Forena module. Here is a quote from that page:

... built of the idea of using SQL to get data out of a database and use XHTML and CSS to format it into web reports.

Here is another quote from Reasons for considering Forena, related to the "CSV" in the question here:

Reports created by Forena ... can be saved (exported) as PDF documents with embedded graphs. Other supported formats for saving a report are CSV, XLS, DOC, HTML, etc.

The steps for creating such CSV files are:

  • a connection to an external database (one time only, for each database).
  • a custom SQL query (where you have the full power of SQL at your fingertips, and various extra features related to it provided by Forena, such as using report parameters, conditional SQL, etc).
  • a custom report (either by an admin, or by just any regular user who is either familiar with creating what is called 'FRX files', or otherwise using the WYSIWYG report editor).
  • saving the report in (eg) CSV format, using one of the typical hyperlinks to do so in a report.

These steps do not require any PHP coding.

If you're interested in an online demo site (prior to installing/testing Forena), then checkout these links:

Disclosure: I'm a co-maintainer (not owner ...) of this module,
I hope this does not violate the site's policy on self-promotion.

0

You can use the Data export import module for data importing exporting purpose. Here is an excerpt about it from the module's project page:

The purpose of this module is to be able to export nodes, taxonomy terms and users to data files and then be able to import these data files into Drupal sites. There may be many uses for this module but the main one would be that it can provide a way to export data from a live Drupal site and then to import that live data into an updated version of that site.

So, data can be exported and then imported - hence the name; Data Export Import.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.