problem with file schemas during export from 5.4.2 to 5.7

Hi still in the process of migrating from 5.4.2 to 5.7, i have a problem with documents exported : the file schema has changed : the file:content filename was used to name the content of a file now it seems that the file:filename value is used

Before that value was empty, so that imported documents have a nameless doc.

How can I export / import filenames correctly ?

  <schema xmlns:file="" name="file">

  <schema xmlns="" name="file">
0 votes

1 answers




Originally the blob did not hold a filename, hence a specific field was used to hold it. Although it's supposed to have been kept compatible (with a listener filling the other value for lazy upgrade, if i'm not mistaken), can you tell where you're seeing this issue, in case it's a break in the compatibility that can be avoided?

If you're just importing/exporting documents once, i guess the more efficient would be to identify the values to copy in the database tables and to use some kind of SQL command.

This would be interesting to add to upgrade notes anyway.


Hi this problem seems to occur on some documents based on a custom doctype implementing the file schema. I don't really understand when the listener you mentionned is supposed to run, but there might have been some kind of problem with it as some documents behave as expected. I will follow your advice and check which field should be updated in the database.

BTW, i edited the second sample : filename is empty !


The file table had indeed an empty filename field.

I updated that field using the name field of the related entry in the content table

0 votes


Can you please tell what issue (visible in the interface or not) this change fixed? I checked and the "lazy upgrade" code i was mentioning is run with MimetypeIconUpdater, on creation and modification of the document. It should not be mandatory for features to keep on working as expected, so there might be a bug somewhere if it's needed.

Also if you still have the SQL statement somewhere, i'd be happy to add it to upgrade notes.


The SQL used to update the field is :

update file f set filename =
SELECT from hierarchy h1 ,hierarchy h2 ,content c 
where f.filename is null and is not null
and = 
and (h2.parentid = and h2.primarytype=&apos;content&apos;)
where f.filename is null ;

so that the binaries (file schema) of imported documents now have a filename.

The "files" schema might need the same kind of fix


Thanks! I'll add it soon (see