Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6815

Re: Restore Course from cli using admin/cli/restore.php

$
0
0
by Lazaros Sotiriadis.  

Hi,

Looks like the only way to create a new course while restoring with specific shortname is using backup::TARGET_EXISTING_DELETING, while the TARGET_NEW_COURSE option always creates new courses adding numbers at the end in both full and short names (at least in latest master branch in which i tested). Correcting the target mode seems to solve the problem and create the courses correctly.

Fullname is always drawn from the backup file and no number is added at the end.
I think we don't want to make the script too complicated to specify everything. Besides we can't specify all restore options from cli.

The restoration uses default admin restore course options.
Severin,
If source is a file we have 2 modes:
1) We provide categoryid: A new course is created with specific shortname (if provided/otherwise the one from the backup file is used) or a course is overwriten if provided shortname (from backup or cli) exists.
2) We don't provide categoryid: An existing course is searched by shortname or id and is overwriten and an error is thrown if no course is found.

If source is a directory: (we have to provide categoryid)
1) Everything from that directory gets restored and gets created/overwriten using backup short and fullnames

To do what you suggest we have to add 2 more options (one or the other) lets say for ex --c (only create) or --o (only overwrite existing) with default option being to do both of them. I guess we are talking for source directory mode only.

I ll try to add that as well and see if we can test it.

Regards,
Lazaros

Viewing all articles
Browse latest Browse all 6815

Trending Articles



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