Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Unable to download documents and media after 6.2 to 7.2 upgrade. 404 Er
I am able to download new files (files I uploaded after 7.2 upgrade), but I am unable to download previous files (files downloadable in 6.2). I receive a ‘404 - File or Directory not found’ error when attempting to download a file from documents and media. I can see all site pages, documents and media are listed correctly in Liferay 7.2. I have tried reindexing all searches, but that did not resolve the issue. Below are some contents of my portal-ext.properties files in each version of Liferay. Should I add the dl.store.file.system.root.dir from 6.2 into 7.2 portal-ext.properties file?
Liferay 6.2 portal-ext:
dl.store.file.system.root.dir=${liferay.home}/data/document_library
dl.store.impl com.liferay.portlet.documentlibrary.store.FileSystemStore
Liferay 7.2 portal-ext:
dl.store.impl=com.liferay.portal.store.file.system.FileSystemStore
Liferay 6.2 portal-ext:
dl.store.file.system.root.dir=${liferay.home}/data/document_library
dl.store.impl com.liferay.portlet.documentlibrary.store.FileSystemStore
Liferay 7.2 portal-ext:
dl.store.impl=com.liferay.portal.store.file.system.FileSystemStore
Hi Brody,Did you copy your DL folder to the new installation before the upgrade?Thanks.
yes, the document library was copied before the upgrade. All users, sites, pages, documents and media are listed. Unable to download from documents and media. Error: 404 - File or Directory not found
Then, it should work, we haven't reproduced this issue in our tests. Could you verify the stacktrace after trying to download those files and check if the file exists in the filesystem before and after the upgrade.Thx
Also, can you attach your upgrade log?
I still receive the ‘404 - File or Directory not found’ error when attempting to download a file. Below are snippets of my portal-ext.properties file. Also, the download link of some files I cannot download are below as well as the file location on backend server. The files exist, but the Liferay GUI can’t locate older files after the 6.2 to 7.2 upgrade. New files that I uploaded after 7.2 upgrade can be downloaded.
Liferay 6.2 portal ext:
dl.hook.impl=com.liferay.documentlibrary.util.AdvancedFileSystemHook
dl.store.file.system.root.dir=${liferay.home}/data/document_library
Liferay 7.2 portal-ext:
dl.store.impl=com.liferay.portal.store.file.system.FileSystemStore
dl.store.file.system.root.dir=${liferay.home}/data/document_library
Download Link:/documents/27431/36212/filename.pdf/29e66731-605d-4d79-8004-f81030ef53d9?t=1560432106173&download=true
File path on server:liferay\data\document_library\20155\36212\23\92\23927.afsh
Download Link:/documents/27431/37158/2018.pdf/9a41e679-09e4-4ecb-872e-ea226d6eb62f?t=1535398565337&download=true
File path on server:liferay\data\document_library\20155\37158\15\1517.afsh
Below is the download link and file path to a new file that I can download
./documents/27431/10032183/testfile.jpg/645cd365-ffe5-49f6-82bd-d41b8e12b9c9?t=1565371045790&download=true
liferay\data\document_library\20155\10032183\24608
Liferay 6.2 portal ext:
dl.hook.impl=com.liferay.documentlibrary.util.AdvancedFileSystemHook
dl.store.file.system.root.dir=${liferay.home}/data/document_library
Liferay 7.2 portal-ext:
dl.store.impl=com.liferay.portal.store.file.system.FileSystemStore
dl.store.file.system.root.dir=${liferay.home}/data/document_library
Download Link:/documents/27431/36212/filename.pdf/29e66731-605d-4d79-8004-f81030ef53d9?t=1560432106173&download=true
File path on server:liferay\data\document_library\20155\36212\23\92\23927.afsh
Download Link:/documents/27431/37158/2018.pdf/9a41e679-09e4-4ecb-872e-ea226d6eb62f?t=1535398565337&download=true
File path on server:liferay\data\document_library\20155\37158\15\1517.afsh
Below is the download link and file path to a new file that I can download
./documents/27431/10032183/testfile.jpg/645cd365-ffe5-49f6-82bd-d41b8e12b9c9?t=1565371045790&download=true
liferay\data\document_library\20155\10032183\24608
BRODY HIGGS JR:
Your 6.2 installation stored the files with the "AdvancedFileSystem" structure, while 7.2 accesses them with Simple-"FileSystem". The storage location for both, despite sharing the same root directory, is different and this is the root cause: During your upgrade, you'll have to use the same store for documents as in your old installation, to find and migrate the binary data properly. It seems that you didn't.
The files exist, but the Liferay GUI can’t locate older files after the 6.2 to 7.2 upgrade. New files that I uploaded after 7.2 upgrade can be downloaded.
Liferay 6.2 portal ext:
dl.hook.impl=com.liferay.documentlibrary.util.AdvancedFileSystemHook
dl.store.file.system.root.dir=${liferay.home}/data/document_library
Liferay 7.2 portal-ext:
dl.store.impl=com.liferay.portal.store.file.system.FileSystemStore
dl.store.file.system.root.dir=${liferay.home}/data/document_library
Naturally, now if you upload new documents, they'll be stored with the same ("FileSystem") format that they're being read, but you can't read those stored with a different underlying directory layout.
Ok. So the solution would be to run the database upgrade again using the following config settings, correct?
Liferay 7.2 Portal-ext.properties:
dl.store.file.system.root.dir=${liferay.home}/data/document_library
dl.store.impl=com.liferay.portal.store.file.system.AdvancedFileSystemStore
tools\portal-tools-db-upgrade-client\portal-upgrade-ext.properties:
dl.store.impl=com.liferay.portal.store.file.system.AdvancedFileSystemStore
Liferay 7.2 Portal-ext.properties:
dl.store.file.system.root.dir=${liferay.home}/data/document_library
dl.store.impl=com.liferay.portal.store.file.system.AdvancedFileSystemStore
tools\portal-tools-db-upgrade-client\portal-upgrade-ext.properties:
dl.store.impl=com.liferay.portal.store.file.system.AdvancedFileSystemStore
Yes Brody, that should work.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™