---
title: "export schema reference"
url: "https://docs.yugabyte.com/stable/yugabyte-voyager/reference/schema-migration/export-schema/"
---

# export schema reference

YugabyteDB Voyager export schema reference

yb-voyager export schema

[Export the schema](/stable/yugabyte-voyager/migrate/migrate-steps/#export-and-analyze-schema "Export the schema") from the source database.

## Syntax

```text
Usage: yb-voyager export schema [ <arguments> ... ]
```

### Arguments

The following table lists the valid flags and parameters for the `export schema` command.

When run at the same time, flags take precedence over configuration flag settings.

CLI flag

Config file parameter Description 

--assessment-report-path

```yaml
export-schema:
  assessment-report-path:
```

Path to the generated assessment report file (JSON format) to be used for applying recommendation to exported schema. 

--skip-colocation-recommendations

```yaml
export-schema:
  skip-colocation-recommendations:
```

Disable applying recommendations in the exported schema suggested by the migration assessment report.  
Default: false  
Accepted parameters: true, false, yes, no, 0, 1 

--comments-on-objects

```yaml
export-schema:
  comments-on-objects:
```

Enable export of comments associated with database objects.  
Default: false  
Accepted parameters: true, false, yes, no, 0, 1 

--object-type-list,  
\--exclude-object-type-list

```yaml
export-schema:
  object-type-list:
  exclude-object-type-list:
```

Comma-separated list of objects to export (--object-type-list) or not (--exclude-object-type-list). You can provide only one of the arguments at a time.  
Example: `yb-voyager export schema …. -object-type-list "TABLE,FUNCTION,VIEW"`  
Accepted parameters:

- Oracle: TYPE, SEQUENCE, TABLE, PACKAGE, TRIGGER, FUNCTION, PROCEDURE, SYNONYM, VIEW, MVIEW
- PostgreSQL: TYPE, DOMAIN, SEQUENCE, TABLE, FUNCTION, PROCEDURE, AGGREGATE, VIEW, MVIEW, TRIGGER, COMMENT
- MySQL: TABLE, VIEW, TRIGGER, FUNCTION, PROCEDURE

--use-orafce

```yaml
export-schema:
  use-orafce:
```

Use the Orafce extension. Oracle migrations only.  
Default: true  
Accepted parameters: true, false, yes, no, 0, 1 

--skip-performance-recommendations

```yaml
export-schema:
  skip-performance-recommendations:
```

Disable automatic [performance optimizations](/stable/yugabyte-voyager/known-issues/postgresql/#performance-optimizations "performance optimizations") in the exported schema.  
Default: false  
Accepted parameters: true, false, yes, no, 0, 1 

--disable-schema-snapshot-capture

```yaml
export-schema:
  disable-schema-snapshot-capture:
```

Turn off recording of source schema snapshots, which [schema detect-drift](/stable/yugabyte-voyager/reference/schema-migration/detect-drift/ "schema detect-drift") reads. Recording is best effort: a failed capture is logged and never fails the export. PostgreSQL only.  
Default: false  
Accepted parameters: true, false, yes, no, 0, 1 

--source-db-type

```yaml
source:
  db-type:
```

One of `postgresql`, `mysql`, or `oracle`. 

--source-db-host

```yaml
source:
  db-host:
```

Domain name or IP address of the machine on which the source database server is running. 

--source-db-port

```yaml
source:
  db-port:
```

Port number of the source database server. 

--source-db-name

```yaml
source:
  db-name:
```

Source database name. 

--source-db-schema

```yaml
source:
  db-schema:
```

Schema name of the source database. Not applicable for MySQL. 

--source-db-user

```yaml
source:
  db-user:
```

Name of the source database user (typically `ybvoyager`). 

--source-db-password

```yaml
source:
  db-password:
```

Password to connect to the source database. If you don't provide a password via the CLI during any migration phase, yb-voyager will prompt you at runtime for a password. Alternatively, you can also specify the password by setting the environment variable `SOURCE_DB_PASSWORD`. If the password contains special characters that are interpreted by the shell (for example, # and $), enclose it in single quotes. 

[--source-ssl-mode](/stable/yugabyte-voyager/reference/yb-voyager-cli/#ssl-connectivity "--source-ssl-mode")

```yaml
source:
  ssl-mode:
```

One of `disable`, `allow`, `prefer`(default), `require`, `verify-ca`, or `verify-full`. 

[--source-ssl-cert](/stable/yugabyte-voyager/reference/yb-voyager-cli/#ssl-connectivity "--source-ssl-cert")

```yaml
source:
  ssl-cert:
```

Path to a file containing the certificate which is part of the SSL `<cert,key>` pair. 

[--source-ssl-key](/stable/yugabyte-voyager/reference/yb-voyager-cli/#ssl-connectivity "--source-ssl-key")

```yaml
source:
  ssl-key:
```

Path to a file containing the key which is part of the SSL `<cert,key>` pair. 

[--source-ssl-crl](/stable/yugabyte-voyager/reference/yb-voyager-cli/#ssl-connectivity "--source-ssl-crl")

```yaml
source:
  ssl-crl:
```

Path to a file containing the SSL certificate revocation list (CRL). 

[--source-ssl-root-cert](/stable/yugabyte-voyager/reference/yb-voyager-cli/#ssl-connectivity "--source-ssl-root-cert")

```yaml
source:
  ssl-root-cert:
```

Path to a file containing SSL certificate authority (CA) certificate(s). 

--oracle-home

```yaml
source:
  oracle-home:
```

Path to set `$ORACLE_HOME` environment variable. `tnsnames.ora` is found in `$ORACLE_HOME/network/admin`. Oracle migrations only. 

[--oracle-tns-alias](/stable/yugabyte-voyager/reference/yb-voyager-cli/#oracle-options "--oracle-tns-alias")

```yaml
source:
  oracle-tns-alias:
```

TNS (Transparent Network Substrate) alias configured to establish a secure connection with the server. Oracle migrations only. 

--oracle-db-sid

```yaml
source:
  oracle-db-sid:
```

Oracle System Identifier you can use while exporting data from Oracle instances. Oracle migrations only. 

-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. (Global parameter: specify at top level in config file) 

--send-diagnostics

```yaml
send-diagnostics:
```

Enable or disable sending [diagnostics](/stable/yugabyte-voyager/reference/diagnostics-report/ "diagnostics") information to Yugabyte.  
Default: true  
Accepted parameters: true, false, yes, no, 0, 1 

-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 

--start-clean — Starts a fresh schema export after clearing the `schema` directory.  
Default: false  
Accepted parameters: true, false, yes, no, 0, 1 

-h, --help — Command line help for schema. 

-y, --yes — Answer "yes" to all prompts during the export schema operation.  
Default: false 

-c, --config-file — Path to a [configuration file](/stable/yugabyte-voyager/reference/configuration-file "configuration file"). 

--run-guardrails-checks

```yaml
export-schema:
  run-guardrails-checks:
```

Run guardrails checks during migration.  
Default: true  
Accepted values: true, false, yes, no, 0, 1  
**Note**: Setting this flag to false is unsafe, as it skips critical pre-migration validations (such as source/target database permissions, binary dependencies, and version compatibility) and may lead to migration failures or data issues. Leave the default (true) unless you have a specific reason to disable checks.

### Example

Configuration file:

```yaml
yb-voyager export schema --config-file <path-to-config-file>
```

CLI:

```sh
yb-voyager export schema --export-dir /dir/export-dir \
        --source-db-type oracle \
        --source-db-host 127.0.0.1 \
        --source-db-port 1521 \
        --source-db-user ybvoyager \
        --source-db-password 'password'  \
        --source-db-name source_db \
        --source-db-schema source_schema \
        --start-clean true
```
