[OJS] Could upgrade process cause deletion of files in the files folder outside of web root?

I noticed many of Word and PDF files were lost randomly. I made copy of the original and tried upgrading using the folder. I might have switch the folders from one version to the other. During the process, I found files/folders were lost mysteriously and randomly. Sometimes they are the entire article submission folders; sometimes some of the folders within an article folder; and sometimes the folders are there but empty. I asked the hosting company to restore several backups but still can’t find them. Could the upgrade process cause removal of files?

This is urgent. Any information would help me to better communicate with hosting company and get help.

Thanks.

Paul

Hi @Paul_Chen,

The upgrade process does rearrange the files_dir, but almost exclusively uses rename operations rather than deletions. I’m not aware of any way the upgrade script could cause seemingly random deletions, especially of entire folders.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher,

Thanks so much for the prompt response. How does the upgrade script rearrange the folder and rename files? Does it also rename folder and change the article_id?

For example, for the most current issue, the PDF files in the first half of the list are gone but the second half is OK. We reuploaded those files to make work. Later we found that many word files in older submissions are gone as well, which is a devastating situation.

Hi @Paul_Chen,

The migration script from OJS 2.x to OJS 3.x changes the style of filenames that OJS uses. OJS 2.x used filenames like 371-1614-1-rv.pdf; OJS 3.x uses filenames like 12-1-22-1-10-20180412.pdf (these are not meant to be equivalent – just examples).

File IDs, article IDs, etc. do not change.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher,

Thanks again. I am sorry I didn’t make it clear earlier. I am having issue after upgrading from 2.3.3 to 2.4.8. Does this upgrade also change file names?

Paul

Hi @Paul_Chen,

Hmm, it’s even less likely that OJS is involved in those files going missing in that case. OJS 2.x essentially never deletes files (unless you do it yourself through the journal manager’s Files Browser) and the upgrade process does not move/delete files.

Regards,
Alec Smecher
Public Knowledge Project Team

I am looking at the file structure in the file_dir. Under the article ID, there may be attachment, submission, and sub. Inside submission, you may have original, proof, review. One of the submission having problem has file residing right under submission with a file name like this: 4297-13-12949-1-2-20180404.docx. A file with similar file name is in proof, which is in fact a cover letter. Both the original and review folders are empty. I noticed the file names inside those folders look like this: 4297-12949-1-SM.DOCX, and most of the articles do not have a file right under submission folder. Could you tell me if this means anything for me to recover the files?

Thank you!

Hi @Paul_Chen,

4297-13-12949-1-2-20180404.docx is an OJS 3.x style filename; OJS 2 wouldn’t generate/use this. This must’ve been renamed during an upgrade from 2.x to 3.x.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher,

Thank you for information. I think there wee a few things that happened during my upgrade attempts and screwed my files" 1) the backup by hosting service was problematic, 2) I thought upgrading to either 2.4.8 or 3.1.1 would not change anything in file_dir and at some point I used the same copy of file folder for the upgrade. I was wrong. I ended up having to copy some folders from 3.1 to 2.4.8 folder structure (e.g., /submission/original, submission/revision, /supp, etc) and rename the files according to the file names shown on the editing pages. For those who need to upgrade to 2.4 before he/she upgrades to 3, please make a copy of your pre-2.4 version for upgrading to 2.4, and make a copy of 2.4 file folder for upgrading to 3.

Paul