Pardon the intrusion ... have done (many moons ago) several of these 'mirgrations' from 1.9.x to 2.2.x in the past and had to investigate such issues.
The following will not specifically address the specific issues you are seeing as no two such migrations had the same results.
Emma could be correct.
Hopefully, the following explanation will help trouble shoot.
So ... having said that ...
First screen shoot shows the data directory has already been touched by
a migration attempt - evidence of 'filedir' in moodledata.
The numbered directories are the old 1.9.x course ID numbers (CID's).
Your find command might have found PDF's in those course ID directories ...
certainly NOT in filedir.
Adjust the command and limit it to single digit CID's and drop the word count.
find ./? -name "*.pdf"
If you try the same command in the filedir directory, it will return no hits.
That's because of the massive change to filesystem in Moodle.
There are no files in filedir that have a file name extension.
Instead, to find a file in filedir, it's a two step process one of which is
a DB query of mdl_files to find the contenthash then using that information
to find the directories/subdiretories/contenthash fileanme of a file then
using something like file -b to double check it is a PDF or other file type.
DB query from command line looking for any file that ends with .pdf:
mysql -u root -p'YOURPASSWORD' -e 'use YOURMOODLEDB;select filename,contenthash from mdl_files where filename like "%.pdf";'
Will/should produce a long listing like this:
| Harry Potter_1_0.pdf | 4c4fa72addf6cfc16c6149bde7cedd01b70af1cf |
| Harry Potter_2_0.pdf | f18a1fb0516afcd77dbdf6380d03a7cbba72e1d2 |
Now one can use the file -b command on the contenthash from filedir directory:
(example looking for the 2nd file listed above):
file -b ./f1/8a/f18a1fb0516afcd77dbdf6380d03a7cbba72e1d2
Would have returned:
[root@sos filedir]# file -b ./f1/8a/f18a1fb0516afcd77dbdf6380d03a7cbba72e1d2
PDF document, version 1.4
Can't view it so you could *copy* that file out of filedir sea of files to web root and change it's name to view with
browser. (not recommending you do this for all files ... it's just an example);
Still in filedir
cp ./f1/8a/f18a1fb0516afcd77dbdf6380d03a7cbba72e1d2 /var/www/html/HarryPotter_2_0.pdf
Then use your browser:
* one exception has to do with Certificates issued in the 1.9.
So to see if that's true in your situation, change into the moodledata directory and issue the following command
on just one of the course ID directories you see:
ls -lR ./CIDNUMBER/
IF you see a modinfo/##/##/ and then a file name like 'Certificate blah blah.pdf' ... those are certificates that could not be moved into new file system.
Attached is a screen snap of a moodledata directory and it should look once cleaned up.
*** what happened? *** Dunno ... hard to say.
You've given some hints that you might be hosted with a provider that moved a shared account to a VPS system ... fact you could not use the true web server user (assuming CentOS - that would be apache:apache - on Ubuntu that would be/should be www-data:www-data).
Even VPS systems might have CAPS ... when processes reach those CAPS the script is killed ... no warnings, no errors recorded anywhere one might look. :\ I would hope not, but that depends upon the 'VPS package' purchased.
The other hint is where you are working ... /home/username/public_html/ indicates even if on a VPS the provider has set you up in a 'user jail' ... and not at true Apache web root .... which on CentOS 7 and Ubuntu 16.04 which are both Linux Standards Based distro's now ... is /var/www/
Now how to fix ... gets in to a lot more detail ... which could be very specific to your situation. I've never been able to 'fix' anything via 'Vulcan Mind Meld'! And, NO, am not asking for access to fix either.
just re-called .. I did have to tweak a MySQL setting ... number of opened files ... for some of the migrations. Got to the point where I did that in advance before the first attempt. NOTE: am not a DB admin by trade ... just a lowly Intructional Tech person.
'spirit of sharing', Ken