Esempio n. 1
0
 def perform_migration(self):
     # Backup the previous config
     setup.backup_config()
     # Get the AiiDA directory path
     aiida_directory = os.path.expanduser(setup.AIIDA_CONFIG_FOLDER)
     # Construct the daemon directory path
     daemon_dir = os.path.join(aiida_directory, setup.DAEMON_SUBDIR)
     # Construct the log directory path
     log_dir = os.path.join(aiida_directory, setup.LOG_SUBDIR)
     # Update the daemon directory
     setup.install_daemon_files(aiida_directory, daemon_dir, log_dir,
                                getpass.getuser())
Esempio n. 2
0
def transition_config_files(profile=None):

    print("Changing backend from Django to SQLAlchemy in config files")

    # Backup the previous config
    setup.backup_config()
    # Get the AiiDA directory path
    aiida_directory = os.path.expanduser(setup.AIIDA_CONFIG_FOLDER)
    # Construct the log directory path
    log_dir = os.path.join(aiida_directory, setup.LOG_SUBDIR)
    # Update the configuration if needed
    confs = change_backend_to_sqla(profile)
    # Store the configuration
    setup.store_config(confs)
    # Construct the daemon directory path
    daemon_dir = os.path.join(aiida_directory, setup.DAEMON_SUBDIR)
    # Update the daemon directory
    setup.install_daemon_files(aiida_directory, daemon_dir, log_dir,
                               getpass.getuser())

    print("Config file update finished.")