protected function doBackupGlobalAliases()
    {
        $aliases = $this->urlAliasHandler->listGlobalURLAliases();
        $totalCount = count($aliases);
        $pathCount = 0;

        if ($totalCount === 0) {
            $this->output->writeln('Could not find any global URL aliases, nothing to backup.');
            $this->output->writeln('');

            return;
        }

        $this->output->writeln("Backing up {$totalCount} global URL aliases.");

        $progressBar = $this->getProgressBar($totalCount);
        $progressBar->start();

        foreach ($aliases as $alias) {
            $pathCount += $this->storeGlobalAlias($alias);
            $progressBar->advance();
        }

        $progressBar->finish();

        $this->output->writeln('');
        $this->output->writeln(
            "Done. Backed up {$totalCount} global URL alias(es) " .
            "with {$pathCount} path(s)."
        );
        $this->output->writeln('');
    }