Changer l'url de moodle

Mon serveur YunoHost

Matériel: Vieil ordinateur
Version de YunoHost: 4.2.7
J’ai accès à mon serveur : En SSH | Par la webadmin | En direct avec un clavier/écran | …
Êtes-vous dans un contexte particulier ou avez-vous effectué des modificiations particulières sur votre instance ? : non
Si oui, expliquer:

Description du problème

Bonsoir,
J’ai installer moodle sur une URL que je dois supprimer.
Sur l’administration la fonctionnaliter n’est pas encore mise en place
Cette fonctionnalité n’a pas encore été implémentée pour cette application

Je sais que je dois désinstaller et réinstaller sur une autre URL mais comment récupérer mes donnée ?
Télecharger la base de donné et la réinstaller sur la nouvelle qui sera créer ?
Faire une sauvegarde sur yunohost ?
Merci de m’expliquer la meilleur façon de procéder.

Je vous en remercie

Cordialement

It could be difficult if some url are hardcoded in moodle database (i don’t know if it’s the case).

A process to do what you want:

  • download the change_url script from example_ynh
cd /etc/yunohost/apps/moodle/scripts
wget https://raw.githubusercontent.com/YunoHost/example_ynh/master/scripts/change_url
  • Disable service reload (cause it’s a php app: no dedicated services)
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"

by

#ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
  • Execute the change url action in webadmin
  • Search in php config of moodle in /var/www/moodle and in postgresql database if there are references to the old URL and replace it
  • Restart php-fpm services and nginx

From ericg on chat:

eric_G
I am trying to add a change_url script to Moodle. It should work (manually it does) apart from the replace string that doesn't replace anything :/
https://github.com/YunoHost-Apps/moodle_ynh/blob/5d30585149b382f370537d6f4ac6bb80e2ce3f26/scripts/change_url#L106-L108

Merci de votre réponse mais :
J’ai eu un problème au moment de modifier dans la webadmin.
Voici le log
https://paste.yunohost.org/raw/levuhukilu

Arf…

La bonne url à télécharger avec wget c’est https://raw.githubusercontent.com/YunoHost/example_ynh/master/scripts/change_url

Donc il faut lancer:

rm change_url
wget https://raw.githubusercontent.com/YunoHost/example_ynh/master/scripts/change_url

Bonjour,

J’ai toujour une erreur :
https://paste.yunohost.org/raw/merebiyaci

Tu étais bien dans /etc/yunohost/apps/moodle/scripts quand tu as l’ancé les commandes ?

cd /etc/yunohost/apps/moodle/scripts
rm change_url
wget https://raw.githubusercontent.com/YunoHost/example_ynh/master/scripts/change_url

Pour moi oui :

After many trial and error, I may have a functional script for change_url that needs to be tested…

sudo yunohost app install https://github.com/YunoHost-Apps/moodle_ynh/tree/testing
or
sudo yunohost app upgrade moodle -u https://github.com/YunoHost-Apps/moodle_ynh/tree/testing 

Voici ce que ça me dit :

Well after upgrading, change_url script doesn’t work… I guess I will have to work a bit more on that…

Ce n’est pas grave prenez votre temps

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.