升级Moodle后删除剩余的旧文件

时间:2023-02-05 12:55:53

I need a way to figure out which files are left over after upgrading Moodle to a newer version.

我需要一种方法来确定在将Moodle升级到更新版本后遗留哪些文件。

I have:

  • Old version + many plugins
  • 旧版+许多插件

  • New version
  • Merged version

In the new version some files have been removed but they still exist in the merged version.

在新版本中,某些文件已被删除,但它们仍然存在于合并版本中。

I could start with the new version and copy all the plugins but many are in different sub folders which will take too long.

我可以从新版本开始并复制所有插件,但许多插件位于不同的子文件夹中,这将花费太长时间。

Is there a quick way to list or delete these left over files?

有没有快速列出或删除这些遗留文件的方法?

1 个解决方案

#1


I would create a clone of Moodle in a separate folder.

我会在一个单独的文件夹中创建一个Moodle的克隆。

git clone git://git.moodle.org/moodle.git moodleclone

Then check the version of Moodle in /version.php in your code - look for $release = '2.x.x. Then checkout the exact version of the Moodle clone

然后在代码中检查/version.php中的Moodle版本 - 查找$ release ='2.x.x.然后查看Moodle克隆的确切版本

cd moodleclone
git checkout v2.x.x

Then use Meld to compare the 2 folders. http://meldmerge.org/

然后使用Meld比较2个文件夹。 http://meldmerge.org/

meld ../moodleclone ../yourmoodleversion

This will then show any code differences between the 2. You can see if its an official Moodle plugin or one that has been added.

这将显示2之间的任何代码差异。您可以看到它是一个官方Moodle插件还是已添加的插件。

It would be better if you use the uninstall plugin option via site admin -> plugins because it should remove any data in your database too. You might also want to do a clean install in a new database using the Moodle clone, then dump and compare the database structure from the clone and your code to see if there are any database changes.

如果您通过站点管理 - >插件使用卸载插件选项会更好,因为它也应该删除数据库中的任何数据。您可能还希望使用Moodle克隆在新数据库中进行全新安装,然后转储并比较克隆和代码中的数据库结构,以查看是否存在任何数据库更改。

#1


I would create a clone of Moodle in a separate folder.

我会在一个单独的文件夹中创建一个Moodle的克隆。

git clone git://git.moodle.org/moodle.git moodleclone

Then check the version of Moodle in /version.php in your code - look for $release = '2.x.x. Then checkout the exact version of the Moodle clone

然后在代码中检查/version.php中的Moodle版本 - 查找$ release ='2.x.x.然后查看Moodle克隆的确切版本

cd moodleclone
git checkout v2.x.x

Then use Meld to compare the 2 folders. http://meldmerge.org/

然后使用Meld比较2个文件夹。 http://meldmerge.org/

meld ../moodleclone ../yourmoodleversion

This will then show any code differences between the 2. You can see if its an official Moodle plugin or one that has been added.

这将显示2之间的任何代码差异。您可以看到它是一个官方Moodle插件还是已添加的插件。

It would be better if you use the uninstall plugin option via site admin -> plugins because it should remove any data in your database too. You might also want to do a clean install in a new database using the Moodle clone, then dump and compare the database structure from the clone and your code to see if there are any database changes.

如果您通过站点管理 - >插件使用卸载插件选项会更好,因为它也应该删除数据库中的任何数据。您可能还希望使用Moodle克隆在新数据库中进行全新安装,然后转储并比较克隆和代码中的数据库结构,以查看是否存在任何数据库更改。