---
title: "End migration"
url: "https://docs.yugabyte.com/stable/yugabyte-voyager/reference/end-migration/"
---

# End migration

YugabyteDB Voyager end migration reference

yb-voyager end migration

Cleans up all the migration-related information and metadata stored in the export directory (export-dir) and databases (source, target, and source-replica). The command also provides an option to back up the schema, data, migration reports, and log files.

## Syntax

```text
Usage: yb-voyager end migration [ <arguments> ... ]
```

### Arguments

The valid *arguments* for end migration are described in the following table:

CLI flag

Config file parameter Description 

--backup-schema-files

```yaml
end-migration:
  backup-schema-files:
```

Back up migration schema files.  
Accepted parameters: true, false, yes, no, 0, 1 

--backup-data-files

```yaml
end-migration:
  backup-data-files:
```

Back up snapshot data files.  
Accepted parameters: true, false, yes, no, 0, 1 

--backup-log-files

```yaml
end-migration:
  backup-log-files:
```

Back up yb-voyager log files for the current migration.  
Accepted parameters: true, false, yes, no, 0, 1 

--save-migration-reports

```yaml
end-migration:
  save-migration-reports:
```

Saves all the reports generated in the migration workflow (`analyze-schema` report, `export data status` output, `import data status` output, or `get data-migration-report`).  
Accepted parameters: true, false, yes, no, 0, 1 

--backup-dir

```yaml
end-migration:
  backup-dir:
```

Directory where the schema, data, logs, and reports are backed up.  
**Note**: Mandatory if any of the following flags are set to true or yes or 1: `--backup-data-files`, `--backup-log-files`, `--backup-schema-files`, `--save-migration-reports`. 

-e, --export-dir

```yaml
export-dir:
```

Path to the export directory. This directory is a workspace used to store exported schema DDL files, export data files, migration state, and a log file. 

-l, --log-level

```yaml
log-level:
```

Log level for yb-voyager.  
Accepted values: trace, debug, info, warn, error, fatal, panic  
Default: info 

--log-max-size-mb

```yaml
log-max-size-mb:
```

Maximum size in MB of a yb-voyager log file before it is rotated. Also applies to the Debezium log file during live migration.  
Default: 200 

--log-max-backups

```yaml
log-max-backups:
```

Maximum number of rotated log files to retain. Older files are deleted. Use -1 to retain all rotated log files.  
Default: 10 

-h, --help — Command line help for import data to source-replica. 

-y, --yes — Answer yes to all prompts during the migration.  
Default: false

### Example

Configuration file:

```sh
yb-voyager end migration --config-file <path-to-config-file>
```

CLI:

```sh
yb-voyager end migration --export-dir /dir/export-dir \
        --backup-log-files true \
        --backup-data-files true \
        --backup-schema-files true \
        --save-migration-reports true \
        --backup-dir /dir/backup-dir
```
