RE: Unable to download documents and media after 6.2 to 7.2 upgrade. 404 Er

BRODY HIGGS JR, modified 6 Years ago. Junior Member Posts: 61 Join Date: 5/16/14 Recent Posts
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
thumbnail
Alberto Chaparro, modified 6 Years ago. Liferay Master Posts: 560 Join Date: 4/25/11 Recent Posts
Hi Brody,Did you copy your DL folder to the new installation before the upgrade?Thanks.
BRODY HIGGS JR, modified 6 Years ago. Junior Member Posts: 61 Join Date: 5/16/14 Recent Posts
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
thumbnail
Alberto Chaparro, modified 6 Years ago. Liferay Master Posts: 560 Join Date: 4/25/11 Recent Posts
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
thumbnail
Alberto Chaparro, modified 6 Years ago. Liferay Master Posts: 560 Join Date: 4/25/11 Recent Posts
Also, can you attach your upgrade log?
BRODY HIGGS JR, modified 6 Years ago. Junior Member Posts: 61 Join Date: 5/16/14 Recent Posts
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
thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
BRODY HIGGS JR:

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

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.
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.
BRODY HIGGS JR, modified 6 Years ago. Junior Member Posts: 61 Join Date: 5/16/14 Recent Posts
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
thumbnail
Alberto Chaparro, modified 6 Years ago. Liferay Master Posts: 560 Join Date: 4/25/11 Recent Posts
Yes Brody, that should work.