export schema reference
yb-voyager export schema
      Export the schema from the source database.
Syntax
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 | 
|---|---|---|
| --run-guardrails-checks |  | 
          Run guardrails checks during migration.  Default: true Accepted values: true, false, yes, no, 0, 1  | 
      
| --assessment-report-path |  | 
          Path to the generated assessment report file (JSON format) to be used for applying recommendation to exported 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 |  | 
          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  | 
           | 
          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: 
  | 
      
| --use-orafce |  | 
          Use the Orafce extension. Oracle migrations only.  Default: true Accepted parameters: true, false, yes, no, 0, 1  | 
      
| --skip-performance-recommendations |  | 
          Disable automatic performance optimizations in the exported schema.  Default: false Accepted parameters: true, false, yes, no, 0, 1  | 
      
| --source-db-type |  | 
          One of postgresql, mysql, or oracle. | 
      
| --source-db-host |  | 
          Domain name or IP address of the machine on which the source database server is running. | 
| --source-db-port |  | 
          Port number of the source database server. | 
| --source-db-name |  | 
          Source database name. | 
| --source-db-schema |  | 
          Schema name of the source database. Not applicable for MySQL. | 
| --source-db-user |  | 
          Name of the source database user (typically ybvoyager). | 
      
| --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 |  | 
          One of disable, allow, prefer(default), require, verify-ca, or verify-full. | 
      
| --source-ssl-cert |  | 
          Path to a file containing the certificate which is part of the SSL <cert,key> pair. | 
      
| --source-ssl-key |  | 
          Path to a file containing the key which is part of the SSL <cert,key> pair. | 
      
| --source-ssl-crl |  | 
          Path to a file containing the SSL certificate revocation list (CRL). | 
| --source-ssl-root-cert |  | 
          Path to a file containing SSL certificate authority (CA) certificate(s). | 
| --oracle-home  | 
           | 
          Path to set $ORACLE_HOME environment variable. tnsnames.ora is found in $ORACLE_HOME/network/admin. Oracle migrations only. | 
      
| --oracle-tns-alias  | 
           | 
          TNS (Transparent Network Substrate) alias configured to establish a secure connection with the server. Oracle migrations only. | 
| --oracle-db-sid  | 
           | 
          Oracle System Identifier you can use while exporting data from Oracle instances. Oracle migrations only. | 
| -e, --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 |  | 
          Enable or disable sending diagnostics information to Yugabyte.  Default: true Accepted parameters: true, false, yes, no, 0, 1  | 
      
| -l, --log-level |  | 
          Log level for yb-voyager.  Accepted values: trace, debug, info, warn, error, fatal, panic Default: info  | 
      
| --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. | 
Example
Configuration file:
yb-voyager export schema --config-file <path-to-config-file>
CLI:
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