Quantcast
Channel: Backup and restore
Viewing all 6648 articles
Browse latest View live

Re: Backup a large course is not working


Canvas to Moodle restore does not display content images.

$
0
0
by Janaka Sampath.  

Hi,

I have tried to restore a course from canvas to moodle which is in IMSCC format.

But the images in the course are not displaying. When I checked the URL of the image it displays as follows.

%24IMS-CC-FILEBASE%24/objective%20header.png?canvas_download=1&canvas_qs_download_frd=1

Please let me know if there is a proper fix for this?

Backing up course sections via CLI or SQL?

$
0
0
by N.R Bhanji.  

Hi Folks,

I'm new to the Moodle Community, so please bear with me.   When performing a Course backup, I know there is the option to select certain sections.  Is there a way to find out what command is run to backup the sections and can that be run via CLI or MySQL? To provide some background, we have some content that is translated from English to French on a weekly basis. Typically we can go in and backup just that week's content from the Master Course and restore to other courses. However rather than manually doing this, is there a way to run this as a command, choosing the appropriate section/week to backup so it's automated. I did search in the forums but was not able to find anything relating to this. Hoping somebody else may have already done this.  Thanks

Re: Backing up course sections via CLI or SQL?

$
0
0
by Ken Task.  

No add-on/plugin of which am aware, but you might be able to put together a couple of cli scripts using moosh

course-restore
Restore course from path/to/backup.mbz to category or existig course.
Example 2: Restore backup.mbz into existing course with id=3

moosh course-restore -e backup.mbz 3

course-backup
Backup course with provided id.

If the course contains only the new section with the translation.  Assume one would use the GUI to do that and that course could be the same one everytime.

Just thinking out loud ...

https://moodle.org/plugins/view.php?id=522

https://moosh-online.com/commands/

'SoS', Ken


Re: Automated Course Backup

$
0
0
by Svenja Lell.  

Hi Emma,

that's of course a good guess ... but www-data user which runs the Moodle cronjob as sufficient privileges to delete the files in the trashfolder.

1.) This is our datafolder:

root@moodleserver:/data2/moodle# ls -al
...
drwxrwxrwx 10 www-data www-data 12288 Nov 13 14:11 temp
drwxrwxrwx 7 www-data www-data 4096 Nov 13 18:17 trashdir
root@moodleserver:/data2/moodle#


2.) example file


root@moodleserver:/data2/moodle/trashdir/2a/ce# ls -al
total 116
drwxrwxrwx 2 www-data www-data 4096 Nov 13 16:00 .
drwxrwxrwx 3 www-data www-data 4096 Nov 13 16:00 ..
-rw-rw-rw- 1 www-data www-data 110558 Nov 5 02:17 2aceeef381c2fe005f56a4d110c045ba549855f5

3.) deletion with www-data - user is possible:

root@moodleserver:/data2/moodle/trashdir/2a/ce# sudo -u www-data /bin/rm /data2/moodle/trashdir/2a/ce/2aceeef381c2fe005f56a4d110c045ba549855f5
root@moodleserver:/data2/moodle/trashdir/2a/ce# ls -al
total 8
drwxrwxrwx 2 www-data www-data 4096 Nov 13 17:26 .
drwxrwxrwx 3 www-data www-data 4096 Nov 13 16:00 ..
root@moodleserver:/data2/moodle/trashdir/2a/ce#

So the privileges are set very generously. Maybe too generously.

However, the prob is right here. The cronjob does not kill the files in the trash folder. Here is root's crontab:

*/15 * * * * sudo -u www-data /usr/bin/php /path/to/moodle/cron.php > /dev/null 2>&1

Can you get me started how to find a solution ? Orphaned files ?


Thanks for you help!


Kind Regards,


Svenja Lell

Re: Automated Course Backup

$
0
0
by Emma Richardson.  

Yes, I apparently did not read your original post correctly. Sorry about that. So chances are that the drive is filling up too quickly. I have also seen that issue with the tmp directory. Sadly, I do not have a fix for this. I had a time when my external mount was not mounted and moodle kept backing up to the temp folder and filled up the local hard drive and I about lost the site. Normally when the backups complete the tmp folder will be cleared out. I thought the trashdir was related to the recycle bin which has its own settings for deletion so it confuses me that that is continuing to grow. Have you checked your recycle bin settings - or maybe I am wrong in my assumption on that folder.

Re: Backing up course sections via CLI or SQL?

$
0
0
by N.R Bhanji.  

Hi Ken,

Thanks for your reply and suggestions.

The master course contains content for different weeks. A specific week's content may be translated to French at a given point. So we would only need that week's content (section) to be backed up and then restored into all the different grade level courses. Currently we use the GUI to only backup the section (week) from the master course that we want. Then using the Upload Courses option, we update the content of all the grade courses by providing a csv file with the course ids and the backup file to upload. This way we keep the existing content in the grade courses and then insert in the new translated section for the specific week.

I looked at the Moosh commands but don't see a way to backup a specific section from the master course. I was hoping there was a way to see the underlying command that is used when we execute the backup of the specific section via the GUI.

Re: Backing up course sections via CLI or SQL?

$
0
0
by Ken Task.  

Think you might be fixated on your idea (which is a good one, just doesn't exist - unless you pay a developer to do a customization).

So you have one master course with these additions and you've had to create/translate via GUI.

What if ... what IF ... for the time being ... new course called 'dev' and in 'dev' only ... ONLY ... the new stuff.   A 'dev' backup from command line/moosh would only include just the one addition.  Would that be doable?   Think so.

You then could also install dev to your master to have a 'master'.

Doable then?

Better yet, advertise for customization ... @  Moodle jobshttps://moodle.org/mod/data/view.php?d=54

Get something customized. ;)

'SoS', Ken


Re: Backing up course sections via CLI or SQL?

Re: Backing up course sections via CLI or SQL?

$
0
0
by N.R Bhanji.  

Thanks Ken. OK, now I get what you're saying about creating a dev only course with that content and backing up only that content with Moosh.

The master course is not a LT1 provider. I will review the links you provided.

Restore Courses Larger than 500 MB

$
0
0
by Elizabeth Cummins.  

I have found a way to restore my large courses. This has helped us tremendously with managing backups!


  1. Log into SFTP and create a directory named “repository” if one doesn’t already exist. Create a directory within the repository folder.  You can name this new directory anything you’d like, but please use only lowercase letters.
  2. Copy the course backup to this new directory location.
  3. Navigate to Site Administration menu > Plugins > Repositories > Manage Repositories
  4. Look for the File System repository and make sure it is enabled and visible.
  5. Place a checkmark in both boxes to allow admins to add a file systemmceclip0.png
  6. Navigate to Site Admin > Plugins > Repositories > File System
  7. Create a new repository instance
  8. Choose any name you wish, and select the folder name from the SFTP (this should populate automatically.  However, you must have done step 1 first.)
  9. Put a checkmark in the Allow relative link box.mceclip1.png
  10. Click Save  (If this has been done correctly, you will now see the new repository under Repositories instances of the site)
  11. Navigate to the front page and click on Restore
  12. Use the file picker (Choose a file) to find the backup.  You will see the newly created repository instance listed last on the left. 
  13. Select the file by clicking on it
  14. Choose Select this File
  15. Perform the restore as usual.

Many unfinished automated course backups

$
0
0
by Bente Olsen.  

I can not figure out what is going on with my automated course backups.

On almost every executed backup I get a number of unfinished backups, and in Moodle's backup report they can have "time taken" set to eg. "13 Nov, 05:51     -     11 Sep, 03:54"  or even to "11 Nov, 05:02     -     21 Oct, 04:51".

Unfinished course backups might be skipped on the next scheduled backup, so maybe Moodle do not see them as failed though they are unfinished.

Some times no "unfinished" file is stored, but usually it is, and luckily they seem to be restoreable.

Any clues how to fix it or how to find out what happens?

Bente

Migration filesdir Files not opening

$
0
0
by Boris T.  

Hi everybody,

A few days ago I migrated from our old Moodle server to another manually (moodledata files migrated via copy/paste). Everything is working properly but files not opening although exists all files. I checked the permission etc. but not lucky.

I have checked to mdl_files table on SQL, everything looks exists even moodledata files exist.

When I click the file to open then I see the error like below:

Thanks for your help.


Moodle File Error




Re: Many unfinished automated course backups

$
0
0
by Ken Task.  

These 'unfinished' should be in moodledata/temp/backup/ and in a 'contenthash' looking folder.   IF there is a backup.mbz file there look at it's size.   The last action is for Moodle to *copy* the backup.mbz file in there to destination as you have set up in backup preferences.    What is your setting?

Many servers fail at the last step ... *copy* ... rather that 'move' ... and for a little time there one has increased space used until the copy has completed ... one has the temp folder and all the xmls + directories related + the backup.mbz file itself located there - so about 2X's the space that one course is using.

IF you left that at default backup files are going to be store in the sea of files ... moodledata/filedir/.

Recommend manually creating a web service accessible directory outside of moodledata ... like /home/mbackups/ and pointing there so you can see them easily, see their size and number of backups.

If you ever have need of more space on server, easy to remove those files ... otherwise, painful to free up space via moodledata/filedir as that involves DB queries to contenthash of .mbz flies, manually removing those contenthash named files, plus removing rows in mdl_files table that referenced them.

IF the report is showing the next backup attempt has already past then confused table.

Had a server that went nuts like that and the only way I can get it back on track was to truncate all tables in DB related to autobackups - especially the one that kept the schedule.

'SoS', Ken


Re: Migration filesdir Files not opening

$
0
0
by Emma Richardson.  

Sounds like maybe files were corrupted during transfer - I would try transferring again. Copy paste? From one server to another? I would suggest something like rsync or ftp.

Ynt: Re: Migration filesdir Files not opening

$
0
0
by RB T.  

Hi Emma,

Thanks for your reply.

I downloaded all the moodledata folder content to my computer with FTP then I uploaded them new server with FTP again.

I didn't think so corrupted all files, because I migrated almost 40 gigs of data. None of them is opening.

Another idea? Thanks!

Ang: Re: Many unfinished automated course backups

$
0
0
by Bente Olsen.  

Hi Ken,

Thank you very much, good to know that there is a place to look after missing backup files, I actually found a couple in moodledata/temp/backup/. I do have my automated mbz files stored separate from Moodle on the server, mainly for the same reason as you mentioned.

I understand "Many servers fail at the last step..." as there isn't really anything I can do about it, I just have to look for the backup.mbz if I miss a backup file? I also guess that there is no reason to create a report in the tracker?

Thanks again & best regards

Bente

Re: Ynt: Re: Migration filesdir Files not opening

$
0
0
by Ken Task.  

FTP apps have 2 transfer modes ... ascii and binary.   Sounds like your transfer might have been ascii rather than binary.

Got a Mac?   Unzip moodledata .... and in filedir pick any file ... see what launches. smile  Or select any file and get info on it.

'SoS', Ken

Ynt: Re: Ynt: Re: Migration filesdir Files not opening

$
0
0
by RB T.  

Hi Ken,
Thanks for your reply.

I have a PC. I downloaded moodledata content with FileZilla to my computer then uploaded the same with FileZilla again to new server.

The FileZilla transfer mode was "Auto" I'm not sure which type is applied while downloading. Although should I downloaded the data with BINARY mode? I am afraid I don't have access to the old server anymore.

I'm trying to upload filesdir content with FileZilla (BINARY) I'm not sure that would work or not.

My files viewing like below:

Moodle Content

Re: Backup a large course is not working

$
0
0
by Visvanath Ratnaweera.  

The PHP CLI program needs much less resources than the CGI version (which goes through the web server). That could be the explanation. So, if you want the CGI version doing the job, increase the resources, mainly RAM.
Viewing all 6648 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>