Difference between revisions of "Search and replace tool"
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
{{Admin tools}} | {{Admin tools}} | ||
Admins can search and replace text e.g. URLs in their Moodle database using the search and replace tool at <nowiki>http://yourmoodlesite.org/admin/tool/replace/index.php</nowiki> (replacing yourmoodlesite.org with the address of your Moodle site). This is useful when a [[Moodle migration|Moodle site is moved from one server to another]] or when the URL changes. | Admins can search and replace text e.g. URLs in their Moodle database using the search and replace tool at <nowiki>http://yourmoodlesite.org/admin/tool/replace/index.php</nowiki> (replacing yourmoodlesite.org with the address of your Moodle site). This is useful when a [[Moodle migration|Moodle site is moved from one server to another]] or when the URL changes. | ||
Line 8: | Line 5: | ||
{{Warning|A database and site backup should be created before performing a search and replace.}} | {{Warning|A database and site backup should be created before performing a search and replace.}} | ||
+ | |||
+ | ==CLI Parameters== | ||
+ | The following parameters can be utilized with the Search and Replace cli sript. | ||
+ | |||
+ | Options: | ||
+ | |||
+ | --search=STRING String to search for. | ||
+ | |||
+ | --replace=STRING String to replace with. | ||
+ | |||
+ | --shorten Shorten result if necessary. | ||
+ | |||
+ | --non-interactive Perform the replacement without confirming. | ||
+ | |||
+ | -h, --help Print out this help. | ||
==See also== | ==See also== |
Latest revision as of 14:52, 11 June 2021
Template:Admin tools Admins can search and replace text e.g. URLs in their Moodle database using the search and replace tool at http://yourmoodlesite.org/admin/tool/replace/index.php (replacing yourmoodlesite.org with the address of your Moodle site). This is useful when a Moodle site is moved from one server to another or when the URL changes.
Alternatively, a command line script can be used to search and replace text. See Administration via command line for details.
CLI Parameters
The following parameters can be utilized with the Search and Replace cli sript.
Options:
--search=STRING String to search for.
--replace=STRING String to replace with.
--shorten Shorten result if necessary.
--non-interactive Perform the replacement without confirming.
-h, --help Print out this help.
See also
- Tracker issue MDL-35099 Convert hidden search/replace script into a proper core admin tool
es:Herramienta para buscar y remplazar fr: Recherche et remplacement de:Datenbank-Suche