---
title: "Database-migrate: The target filesystem does not have enough free space for migration"
description: "Database-migrate playbooks may incorrectly report insufficient free space on the target filesystem during migration. The issue can be resolved by manually adjusting the disk space check path in the migratechecks.yml file and rerunning the playbook."
url: "https://docs.itrsgroup.com/docs/faq/opsview/4922847198493-opsview-database-migrate-the-target-filesystem-does-not-have-enough-free-space-for-migration/index.html"
---
## Symptoms

- You see the following error when running one of the `database-migrate` playbooks:

```
2021-04-26 16:56:28,475 p=46074 u=root | TASK [opsview_database_migrate : Ensure that target has enough disk space available] ***

2021-04-26 16:56:28,476 p=46074 u=root | task path: /opt/opsview/deploy/lib/roles/opsview_database_migrate/tasks/migrate_checks.yml:167

2021-04-26 16:56:28,476 p=46074 u=root | Monday 26 April 2021 16:56:28 +0000 (0:00:00.249) 0:00:10.344 *****

2021-04-26 16:56:28,752 p=46074 u=root | fatal: [database-host]: FAILED! => changed=false

failed_when_result: true

msg: |-

The target filesystem does not have enough free space for migration:
```

- Your database server has sufficient space for the migration (enough space to hold a second copy of your largest database)

## Cause: Incorrect disk space calculation

*Known issue: OP-47942*

There is a known issue with the `database-migrate` playbooks: they do not calculate the available disk space correctly.

### Solution

1. Log in to the orchestrator as `root`.
2. Back up the `migrate_checks.yml` file:

```
cp -p /opsview/deploy/lib/roles/opsview_database_migrate/tasks/migrate_checks.yml  /opt/opsview/deploy/lib/roles/opsview_database_migrate/tasks/migrate_checks.yml.bak
```

3. Open the `/opsview/deploy/lib/roles/opsview_database_migrate/tasks/migrate_checks.yml` file with your preferred text editor.
4. Change the line

```
df -B1 {{ _opsview_database_migrate_target_data_dir.stdout }} | awk '$NF == "/" { print $4 }'
```

to

```
df -P -B1 </path/to/database/mount/> | awk '$NF ~ /^\// { print $4 }''
```

Make sure you replace `</path/to/database/mount/>` with the path to your database mount, e.g. `/var/lib/mysql/`.

5. Run the `database-migrate` playbook again.


