Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-28346

Performing a backup fails when a file is missing

    Details

    • Testing Instructions:
      Hide

      Test pre-requisites

      • A course
      • All file used must be different
      • A forum activity with several posts
        • One post with an image in description (call the file forum_desc.jpg)
        • One post with a file as attachment (call the file forum_attach.txt)
      • A file resource activity with a file in it (call the file file_attach.txt)
      • You can receive emails sent to the admin
      • The tests have to be done one after the other

      Test #1

      1. Navigate to Home ► Courses ► YOUR CATEGORY ► YOUR COURSE ► Backup
      2. Create a backup of the course (leave settings as default)
      3. Make sure the backup finishes without warnings
      4. Save the new backup file for later use, I will call it test1.mbz

      Test #2

      1. Delete the files from moodledata (see procedure below)
      2. Backup your course
      3. Make sure the backup does not fail
      4. Make sure a warning message is printed out to tell you that some files were missing
      5. Save the new backup file for later use, I will call it test2.mbz

      Test #3

      1. Run the `php admin/cli/automated_backups.php`
      2. Make sure the backup ends without unexpected errors
      3. Make sure the console output display information about the missing files
      4. Navigate to Home ► Site administration ► Reports ► Backups
      5. Make sure the course backup status is 'Warning'
      6. Make sure the email sent to the admin displays that a backup had warnings

      Test #4

      1. Navigate to Home ► Courses ► YOUR CATEGORY ► YOUR COURSE ► Restore
      2. Use test2.mbz to restore the course into a new course
      3. Make sure the restore succeeded
      4. Make sure a warning message told you that some files were missing

      Test #5

      1. Navigate to Home ► Courses ► YOUR CATEGORY ► YOUR COURSE ► Restore
      2. Use test1.mbz to restore the course into a new course
      3. Make sure the restore succeeded without any warning

      Delete the files from moodledata

      1. Browse your table mdl_files ordered by ID DESC
      2. Look for the rows matching the file names as specified the pre-requisites (forum_attach, forum_desc, file_attach)
      3. Note down the contenthash for each of them, ie.: da39a3ee5e6b4b0d3255bfef95601890afd80709
      4. Browse to the directories $CFG->dataroot/filedir/da/39 (using the 4 first letters of the contenthash)
      5. Rename the file named as the contenthash. ie.: da39a3ee5e6b4b0d3255bfef95601890afd80709.DELETED
      6. You're done!
      Show
      Test pre-requisites A course All file used must be different A forum activity with several posts One post with an image in description (call the file forum_desc .jpg) One post with a file as attachment (call the file forum_attach .txt) A file resource activity with a file in it (call the file file_attach .txt) You can receive emails sent to the admin The tests have to be done one after the other Test #1 Navigate to Home ► Courses ► YOUR CATEGORY ► YOUR COURSE ► Backup Create a backup of the course (leave settings as default) Make sure the backup finishes without warnings Save the new backup file for later use, I will call it test1.mbz Test #2 Delete the files from moodledata (see procedure below) Backup your course Make sure the backup does not fail Make sure a warning message is printed out to tell you that some files were missing Save the new backup file for later use, I will call it test2.mbz Test #3 Run the `php admin/cli/automated_backups.php` Make sure the backup ends without unexpected errors Make sure the console output display information about the missing files Navigate to Home ► Site administration ► Reports ► Backups Make sure the course backup status is 'Warning' Make sure the email sent to the admin displays that a backup had warnings Test #4 Navigate to Home ► Courses ► YOUR CATEGORY ► YOUR COURSE ► Restore Use test2.mbz to restore the course into a new course Make sure the restore succeeded Make sure a warning message told you that some files were missing Test #5 Navigate to Home ► Courses ► YOUR CATEGORY ► YOUR COURSE ► Restore Use test1.mbz to restore the course into a new course Make sure the restore succeeded without any warning Delete the files from moodledata Browse your table mdl_files ordered by ID DESC Look for the rows matching the file names as specified the pre-requisites ( forum_attach , forum_desc , file_attach ) Note down the contenthash for each of them, ie.: da39a3ee5e6b4b0d3255bfef95601890afd80709 Browse to the directories $CFG->dataroot/filedir/da/39 (using the 4 first letters of the contenthash) Rename the file named as the contenthash. ie.: da39a3ee5e6b4b0d3255bfef95601890afd80709.DELETED You're done!
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-28346-master

      Description

      My language is Portuguese of Brazil, or will post in both languages.
      I have problems to build up some courses.
      I tried every way possible before resorting to you, and I saw that I can no longer solve this problem.
      I have the moodle distribution of fully intact, without code modifications, or were talking to a native installation files.
      Summarizing the problem, for some courses I run the backup normally, but for others I see that the directory "/ moodledata / temp / backup" files it generates, but it seems he can not direct the file "*. nu.mbz" to the database by stopping the process.
      I made the migration from version 1.9.7 to 2.0.2
      I use postgres 8.3, Moodle 2.0.2, php 5.3.8
      Below lay the screen printing, which are the errors in detail with the debugger enabled function

      Please ask for special attention, because I saw some post in the forums related solutions fancy, and using Moodle for teaching instuição over 3000 subjects and we have created this solution as soon as possible.

      Regards

      --------------------------------------------------

      Meu idioma é português do Brasil, ou seja irei postar nas duas línguas.
      Estou com problemas para criar backup de alguns cursos.
      Tentei todas as formas possíveis antes de recorrer para vocês, e acabei vendo que não consigo mais resolver este problema.
      Tenho a distribuição do moodle totalmente intacta, sem modificações no código, ou seja estavamos falando de uma instalação com arquivos nativos.
      Resumindo o problema, para alguns cursos consigo gerar o backup normalmente, porém para outros vejo que no diretório "/moodledata/temp/backup" ele gera os arquivos, porém parece que ele não consegue direcionar o arquivo "*.nu.mbz" para o banco de dados, parando o processo.
      Fiz a migração da versão 1.9.7 para 2.0.2
      Utilizo postgres 8.3, moodle 2.0.2, php 5.3.8
      Abaixo coloco as impressão da tela, na qual estão os erros detalhadamente com a função de debbug ativada

      Por favor peço uma atenção especial, pois vi alguns post relacionados nos fóruns com soluções mirabolantes, sendo que utilizamos o moodle para instuição de ensino com mais de 3000 disciplinas criadas e precisamos desta solução o quanto antes.

      Abraço,

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  11 Vote for this issue
                  Watchers:
                  17 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Sep/12