kolibri/core/content/management/commands/content.py
def migrate(self, src, dst):
        """
        Migrate the content from current content directory to the destination.
        """
        logger.info("Current content directory is {}".format(src))
        logger.info("Migrating the content into {}".format(dst))

        databases_src = os.path.join(src, "databases")
        databases_dst = os.path.join(dst, "databases")
        storage_src = os.path.join(src, "storage")
        storage_dst = os.path.join(dst, "storage")

        # Check if destination has content by checking if databases folder is not empty
        dst_content_exists = os.path.exists(databases_dst) and os.listdir(databases_dst)

        # If destination has content inside, ask users if they want to overwrite content
        if dst_content_exists:
            self.ask_user_overwrite_or_keep_content(src, dst)

        # copy the databases folder
        self.copy_content(databases_src, databases_dst)
        shutil.rmtree(databases_src)

        # copy the storage folder only when the source folder contains it
        if os.path.exists(storage_src):
            self.copy_content(storage_src, storage_dst)
            shutil.rmtree(storage_src)

        self.update_config_content_directory(dst)

        Migrate the content from current content directory to the destination.
        
Migrate the content from current content directory to the destination.
Migrate the content from current content directory to the destination .
def migrate(self, src, dst):
        logger.info("Current content directory is {}".format(src))
        logger.info("Migrating the content into {}".format(dst))
        databases_src = os.path.join(src, "databases")
        databases_dst = os.path.join(dst, "databases")
        storage_src = os.path.join(src, "storage")
        storage_dst = os.path.join(dst, "storage")
        dst_content_exists = os.path.exists(databases_dst) and os.listdir(databases_dst)
        if dst_content_exists:
            self.ask_user_overwrite_or_keep_content(src, dst)
        self.copy_content(databases_src, databases_dst)
        shutil.rmtree(databases_src)
        if os.path.exists(storage_src):
            self.copy_content(storage_src, storage_dst)
            shutil.rmtree(storage_src)
        self.update_config_content_directory(dst)
def migrate ( self , src , dst ) : logger . info ( "Current content directory is {}" . format ( src ) ) logger . info ( "Migrating the content into {}" . format ( dst ) ) databases_src = os . path . join ( src , "databases" ) databases_dst = os . path . join ( dst , "databases" ) storage_src = os . path . join ( src , "storage" ) storage_dst = os . path . join ( dst , "storage" ) dst_content_exists = os . path . exists ( databases_dst ) and os . listdir ( databases_dst ) if dst_content_exists : self . ask_user_overwrite_or_keep_content ( src , dst ) self . copy_content ( databases_src , databases_dst ) shutil . rmtree ( databases_src ) if os . path . exists ( storage_src ) : self . copy_content ( storage_src , storage_dst ) shutil . rmtree ( storage_src ) self . update_config_content_directory ( dst )
Migrate the content from current content directory to the destination.
Migrate the content from current content directory to the destination .
"""
        Migrate the content from current content directory to the destination.
        """ # Check if destination has content by checking if databases folder is not empty # If destination has content inside, ask users if they want to overwrite content # copy the databases folder # copy the storage folder only when the source folder contains it
self
src
dst