To export contents to a CSV or worksheet in Drupal 7, you may use any of the following:
- Views Data Export module
- Node Export module
Views Data Export module
Project page here: https://www.drupal.org/project/views_data_export
- Go to Administration > Extend
- Enable the module
- Go to Views, create a Page Display, example below, this is needed so the Data Export, in the next step, can be attached to this:
Format: Table
Fields: set as needed (create specific displays, for instance, to create exporters for each content type)
Path:/views-data-export/all - In the same Views, create a Data Export Display, attach this to the Page Display, example:
Format: CSV file
Format Settings: Provide as file, in Filename, %view.csv can be replaced to set a custom filename.CSV as needed
Fields: set as needed (create specific displays, for instance, to create exporters for each content type)
Path:/data/export/all.csv (important to end the path with a CSV file extension so this will generate a CSV file download when accessed)
Attach to: Page - Access directly the URL path e.g. www.website.com/data/export/all.csv, or if from the Page Display view, the CSV button found at the bottom
The Page Display can be customized with exposed filters and other filtering, so you can export what you need from this page
You may follow the same steps provided here: https://www.drupal.org/node/1820452
Some helpful tips if encountering issue with timeout or issues related to large data display and export is to limit each export by batches, or possibly by content type, whatever is needed and can work.
For instance:
This page isn’t working example.com is currently unable to handle this request.
HTTP ERROR 500
- Under the Views page display settings > DATA EXPORT SETTINGS
- Under PAGER > Items to display: Display all items | All items
change Display all items (this exports all contents) to a limited number only as needed - On the next run, Display a specified number of items
Items per page, set as before, but offset the first numbers already exported to be skipped.
Node Export module
Project page here: https://www.drupal.org/project/node_export
In the Drupal 7 version of node export you must enable the type of export in the configuration: /admin/config/content/node_export