Help with movedirectory

I am in process of building new server to send to Indonesia and want to have content for Kolibri on separate drive to help with efficient backup of Kolibri server only (not backing up content)

Kolibri server version is built as VM inside Proxmox server and here is Kolibri device info

Version: 0.15.11
OS: Linux-5.4.0-139-generic-x86_64-with-glibc2.29
Python: 3.8.10
Installer: deb kolibri-server - 0.4.0-0ubuntu2
Server: nginx/1.18.0 (Ubuntu)
Database: /home/kolibri/.kolibri/db.sqlite3
Free disk space: 4 GB
Server time: Sun Feb 12 2023 06:59:54 GMT-0500 (Eastern Standard Time)
Server timezone: Etc/UTC
Device ID: 10329e74ff0165005172dc22c84b815c

After initial build of Kolibri server, a 500GB drive was added (initialized, formatted, fstab edit, mounted, chown) to /koldisk and then created a subdirectory of /koldisk/koldata

The server had limited content in the channels before the movedirectory command was executed. This is copy of terminal during the movedirectory execution

kolibri@kolibri:~$ kolibri manage content movedirectory /koldisk/koldata
INFO 2023-02-12 11:36:50,020 Option DEBUG in section [Server] being overridden by environment variable KOLIBRI_DEBUG
INFO 2023-02-12 11:36:50,020 Option DEBUG_LOG_DATABASE in section [Server] being overridden by environment variable KOLIBRI_DEBUG_LOG_DATABASE
/usr/lib/python3/dist-packages/kolibri/dist/rest_framework/utils/serializer_helpers.py:107: SyntaxWarning: “is” with a literal. Did you mean “==”?
if value is None or value is ‘’:
INFO 2023-02-12 11:36:50,394 Running Kolibri with the following settings: kolibri.deployment.default.settings.base
INFO 2023-02-12 11:36:50,502 Importing ‘tasks’ module from django apps
INFO 2023-02-12 11:36:50,558 Invoking command content movedirectory /koldisk/koldata
INFO 2023-02-12 11:36:50,703 Current content directory is /home/kolibri/.kolibri/content
INFO 2023-02-12 11:36:50,703 Migrating the content into /koldisk/koldata
INFO 2023-02-12 11:36:51,379 Option DEBUG in section [Server] being overridden by environment variable KOLIBRI_DEBUG
INFO 2023-02-12 11:36:51,379 Option DEBUG_LOG_DATABASE in section [Server] being overridden by environment variable KOLIBRI_DEBUG_LOG_DATABASE
Traceback (most recent call last):
File “/usr/bin/kolibri”, line 11, in
load_entry_point(‘kolibri==0.15.11’, ‘console_scripts’, ‘kolibri’)()
File “/usr/lib/python3/dist-packages/kolibri/dist/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/usr/lib/python3/dist-packages/kolibri/dist/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/usr/lib/python3/dist-packages/kolibri/dist/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib/python3/dist-packages/kolibri/utils/cli.py”, line 200, in invoke
return super(KolibriDjangoCommand, self).invoke(ctx)
File “/usr/lib/python3/dist-packages/kolibri/dist/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/lib/python3/dist-packages/kolibri/dist/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/usr/lib/python3/dist-packages/kolibri/dist/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/usr/lib/python3/dist-packages/kolibri/utils/cli.py”, line 368, in manage
execute_from_command_line([“kolibri manage”] + ctx.args)
File “/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/init.py”, line 364, in execute_from_command_line
utility.execute()
File “/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/init.py”, line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/base.py”, line 283, in run_from_argv
self.execute(*args, **cmd_options)
File “/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/base.py”, line 330, in execute
output = self.handle(*args, **options)
File “/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/content.py”, line 36, in handle
self.move_content_directory(options[“destination”])
File “/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/content.py”, line 74, in move_content_directory
self.migrate(content_directory, destination)
File “/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/content.py”, line 104, in migrate
self.update_config_content_directory(dst)
File “/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/content.py”, line 140, in update_config_content_directory
update_options_file(“Paths”, “CONTENT_DIR”, dst, KOLIBRI_HOME)
File “/usr/lib/python3/dist-packages/kolibri/utils/options.py”, line 872, in update_options_file
conf.write()
File “/usr/lib/python3/dist-packages/kolibri/dist/configobj.py”, line 2128, in write
with open(self.filename, ‘wb’) as h:
IsADirectoryError: [Errno 21] Is a directory: ‘/home/kolibri/.kolibri’

The move seemed to be successful from looking at the new directories (databases, storage) now created in /koldisk/koldata

However, when importing more content the size of the /koldisk/koldata directory does not increase. The size of /home/kolibri/.kolibri/content directory increases instead.

May I please ask for some help and guidance to find a solution to the issue I am having with moving the Kolibri channels files.

Thank you,
David

Hi @mrdavidhaag,

This appears to be a bug with Kolibri - when you initiate the content directory move, it first moves all the content, and then tries to rewrite the options.ini file to store this change permanently. It is at this final stage that the move is erroring out (so after all the files have already been moved).

If you could open up the options.ini file in /home/kolibri/.kolibri and add/edit the following lines, this should be resolved:

[Paths]
CONTENT_DIR = /koldisk/koldata

Once Kolibri has been restarted, this should now be properly setup.

Do let me know if there are any further issues here, and I’ve filed a follow up issue on github for this!

Kind Regards,
Richard

Hello @richard

Thank you for the prompt solution. The edit of options.ini file resolved the issue

The server information immediately shows the extra storage space

Version: 0.15.11
OS: Linux-5.4.0-139-generic-x86_64-with-glibc2.29
Python: 3.8.10
Installer: deb kolibri-server - 0.4.0-0ubuntu2
Server: nginx/1.18.0 (Ubuntu)
Database: /home/kolibri/.kolibri/db.sqlite3
Free disk space: 499 GB
Server time: Mon Feb 13 2023 17:01:54 GMT-0500 (Eastern Standard Time)
Server timezone: Etc/UTC
Device ID: 10329e74ff0165005172dc22c84b815c

I have downloaded more content and the new content is being stored at the new /koldisk/koldata location.

Thank you for the excellent support.

Kind regards,
David