First, check if you have followed the [version-specific upgrade instructions for 14.2](../../../update/index.md#1420).
If you have, you can [manually finish the batched background migration](#manually-finishing-a-batched-background-migration).
If you haven't, choose one of the following methods:
1. Update to either 14.0.5 or 14.1.
1.[Rollback and upgrade](#roll-back-and-follow-the-required-upgrade-path) through one of the required
1.[Check the status](#check-the-status-of-background-migrations) of the batched background migration from the error message, and make sure it is listed as finished. If it is still active, either wait until it is done, or finalize it manually using the command suggested in the error, for example:
versions before updating to 14.2+.
1.[Roll forward](#roll-forward-and-finish-the-migrations-on-the-upgraded-version), staying on the current
version and manually and ensure that the batched migrations complete successfully.
#### Roll back and follow the required upgrade path
1.[Rollback and restore the previously installed version](../../../update/restore_after_failure.md#roll-back-to-an-earlier-version-and-restore-a-backup)
1. Update to either 14.0.5 or 14.1 **before** updating to 14.2+
1.[Check the status](#check-the-status-of-background-migrations) of the batched background migrations and
make sure they are all marked as finished before attempting to upgrade again. If any remain marked as active,
you can [manually finish them](#manually-finishing-a-batched-background-migration).
#### Roll forward and finish the migrations on the upgraded version
##### For a deployment with downtime
To run all the batched background migrations, it can take a significant amount of time
depending on the size of your GitLab installation.
1.[Check the status](#check-the-status-of-background-migrations) of the batched background migrations in the
database, and [manually run them](#manually-finishing-a-batched-background-migration) with the appropriate
arguments until the status query returns no rows.
1. When the status of all of all them is marked as complete, re-run migrations for your installation.
1.[Complete the database migrations](../../../administration/raketasks/maintenance.md#run-incomplete-database-migrations) from your GitLab upgrade:
```plaintext
sudo gitlab-rake db:migrate
```
1. Run a reconfigure:
```plaintext
sudo gitlab-ctl reconfigure
```
1. Finish the upgrade for your installation.
##### For a no-downtime deployment
As the failing migrations are post-deployment migrations, you can remain on a running instance of the upgraded
version and wait for the batched background migrations to finish normally.
1. [Check the status](#check-the-status-of-background-migrations) of the batched background migration from
the error message, and make sure it is listed as finished. If it is still active, either wait until it is done,
or [manually finish it](#manually-finishing-a-batched-background-migration).
1. Re-run migrations for your installation, so the remaining post-deployment migrations finish.
### Manually finishing a batched background migration
If you need to manually finish a batched background migration due to an