run_pg_upgrade

in files/gitlab-ctl-commands/lib/gitlab_ctl/pg_upgrade.rb [143:173]


    def run_pg_upgrade
      unless GitlabCtl::Util.progress_message('Upgrading the data') do
        begin
          run_pg_command(
            "#{target_version_path}/bin/pg_upgrade " \
            "-b #{initial_version_path}/bin " \
            "--old-datadir=#{data_dir}  " \
            "--new-datadir=#{tmp_data_dir}.#{target_version.major}  " \
            "-B #{target_version_path}/bin "
          )
        rescue GitlabCtl::Errors::ExecutionError => e
          log "Error upgrading the data to version #{target_version}"
          log "STDOUT: #{e.stdout}"
          log "STDERR: #{e.stderr}"
          false
        rescue Mixlib::ShellOut::CommandTimeout
          log ""
          log "Timed out during the database upgrade.".color(:red)
          log "To run with more time, remove the temporary directory #{tmp_data_dir}.#{target_version.major},".color(:red)
          log "then re-run your previous command, adding the --timeout option.".color(:red)
          log "See the docs for more information: https://docs.gitlab.com/omnibus/settings/database.html#upgrade-packaged-postgresql-server".color(:red)
          log "Or run gitlab-ctl pg-upgrade --help for usage".color(:red)
          false
        end
      end
        raise GitlabCtl::Errors::ExecutionError.new(
          'run_pg_upgrade', '', 'Error upgrading the database'
        )
      end
    end