File maintenance main interface

This project is not covered by Drupal’s security advisory policy.

Drupal 7 users ending up here, please see this comment and this one.

Introduction

Ever wanted to move files from your sites/default/files directory (or whatever you have configured) to a (new) subdirectory? Never did it because you knew it's a damn mess since you need do move the physical file, adjust the database files table and look through all the node_revisions table and other content to adjust the link to the file so as not to break your site?
After numerous such requests by clients and searching for a module to do just that, I got fed up about this huge Drupal core shortcoming, in my humble opinion, and wrote File maintenance.

What this module is not

Then what is it?

It is constructed to be a bit like the Drupal core admin/content/node page. You get an overview of all the directories in Drupal's files table. Note those bold words: files table! File maintenance starts by scanning your files table and builds its management page from there. If you have files in Drupal's files directory that are not in the files table, they are not picked up! However if you have files present in the files table that are not on disk, they will be noticed and are highlighted in red.

Per directory found, the files inside it will be listed. You can sort the list or filter it by entering (part of) the file name (using * as a wildcard) in the filter field.
You can mark the files you wish to act upon and choose the appropriate bulk action which will start a batch process to act on all the files you have selected.
The batch process will act on every selected file separately, modifying the file on disk, the reference in the files table and search and replace any textual path reference in the node_revisions table so as not to break any HTML content referring to the old path of the file. You can add any table and field to search in using the advanced settings pane on the settings page.

When the bulk action is finished, you will be presented with a report of all files processed. The data of this report resides in the cache table and will stay there indefinitely. Unless you clear the cache tables ;-)

NOTE: File maintenance modifies your database in a number of ways during the batch process, so you better have a database backup at hand!

NOTE 2: Due to the specific nature of the SQL queries used, this module is compatible with PostgreSQL starting from version 6.x-1.1 and onward!

Why would I use File maintenance

  • If you have a huge amount of files in your sites/default/files directory causing IMCE to be slooooooooow and want to clean up the mess.
  • If you simply want to clean up the files directory and/or it's subdirectories.
  • If you want to migrate all of the files when changing the File system settings under admin/settings/file-system
  • Any other reason you can think of to tinker with the files table ;-)

Project information

Releases