I write you again only to tell you that I have accomplished it, I have an Usage Statistics chart with downloads data for my articles which the chart was not displayed.
I have followed your tips in your previous response. I left as sample the process to convert a supplementary galley from a submssion to primary galley, this is the scenario:
I have a submission of an article, the submission_id=8. For this submission I have a galley which was created with the “Other” article component option. This galley has the galley_id=30 and genre_id=12. The file associated to this galley was an XML which has the file_id=45. well the goal is turn this supplementary galley to submission (primary) galley. The working process is composed with the following steps:
In the submission_files table:
UPDATE submission_files SET genre_id=1 WHERE submission_id=8 and file_id=45;
In the submission_file_settings table:
DELETE FROM submission_file_settings WHERE file_id=45 and setting_name!='name';
In the submission_supplementary_files table:
DELETE FROM submission_supplementary_files WHERE file_id=45;
In the files_dir directory, I have renamed all the files associated with the galley. I have noticed that each time you use the change file from Administrator interface, this action uploads the file keep the previous file up. Well because we used multiple times that action, I have 31 different version for this file in my files_dir/journals/1/articles/8/submission/proof. Well I could rename file per file, but I have found a easy way using the following command:
for f in *.xml; do mv "$f" "$(echo "$f" | sed s/12/1/)"; done
The rename of files only consists in change from 8-12-45-11-10-20170406.xml to 8-1-45-11-10-20170406.xml the genre_id from 12 to 1.
Well after run the command to reload the scheduled task associated with the statistics:
php tools/runScheduledTasks.php lib/pkp/plugins/generic/usageStats/scheduledTasks.xml
And clean all the template cache generated I have got the following chart:
Thansk a lot for your help @bozana