code: def main(args):
      """Upgrade the databases for current version"""
      print(
          "Upgrading your database may damage your data. Make sure to make a backup before the "
          "upgrade and stop any other process that may read/write the database during the upgrade."
      )
  
      if not args.get("force"):
          action = ""
          while action not in ["y", "yes", "no", "n"]:
              action = ask_question(
                  "Do you wish to proceed? (y/N)", "N"
              ).lower()
  
          if action in ["no", "n"]:
              sys.exit(0)
  
      config = experiment_builder.get_cmd_config(args)
      storage_config = config.get("storage")
  
      if storage_config is None:
          storage_config = {"type": "legacy"}
  
      storage_config["setup"] = False
  
      builder = experiment_builder.ExperimentBuilder(storage_config)
  
      upgrade_db_specifics(builder.storage)
  
      print("Updating documents...")
      upgrade_documents(builder.storage)
      print("Database upgrade completed successfully")
  
file_path: orion/src/orion/core/cli/db/upgrade.py
imports: import argparse
  import logging
  import sys
  from orion.core.io import experiment_builder
  from orion.core.io.config import ConfigurationError
  from orion.core.io.database.ephemeraldb import EphemeralCollection
  from orion.core.io.database.mongodb import MongoDB
  from orion.core.io.database.pickleddb import PickledDB
  from orion.storage.legacy import Legacy
label_desc: Use image node_id 3 for calling a global function with example usage: main(args) without return types