@@ -30,9 +30,9 @@ import (
30
30
"text/template"
31
31
32
32
"github.com/samber/lo"
33
-
34
33
log "github.com/sirupsen/logrus"
35
34
"github.com/spf13/cobra"
35
+
36
36
"github.com/yugabyte/yb-voyager/yb-voyager/src/cp"
37
37
"github.com/yugabyte/yb-voyager/yb-voyager/src/metadb"
38
38
"github.com/yugabyte/yb-voyager/yb-voyager/src/migassessment"
@@ -54,8 +54,8 @@ type UnsupportedFeature struct {
54
54
55
55
var assessMigrationCmd = & cobra.Command {
56
56
Use : "assess-migration" ,
57
- Short : "Assess the migration from source database to YugabyteDB." ,
58
- Long : `Assess the migration from source database to YugabyteDB.` ,
57
+ Short : "Assess the migration from source (PostgreSQL) database to YugabyteDB." ,
58
+ Long : `Assess the migration from source (PostgreSQL) database to YugabyteDB.` ,
59
59
60
60
PreRun : func (cmd * cobra.Command , args []string ) {
61
61
validateSourceDBTypeForAssessMigration ()
@@ -74,10 +74,51 @@ var assessMigrationCmd = &cobra.Command{
74
74
},
75
75
}
76
76
77
+ func registerSourceDBConnFlagsForAM (cmd * cobra.Command ) {
78
+ cmd .Flags ().StringVar (& source .DBType , "source-db-type" , "" ,
79
+ "source database type: (postgresql)\n " )
80
+
81
+ cmd .Flags ().StringVar (& source .Host , "source-db-host" , "localhost" ,
82
+ "source database server host" )
83
+
84
+ cmd .Flags ().IntVar (& source .Port , "source-db-port" , 0 ,
85
+ "source database server port number. Default: PostgreSQL(5432)" )
86
+
87
+ cmd .Flags ().StringVar (& source .User , "source-db-user" , "" ,
88
+ "connect to source database as the specified user" )
89
+
90
+ // TODO: All sensitive parameters can be taken from the environment variable
91
+ cmd .Flags ().StringVar (& source .Password , "source-db-password" , "" ,
92
+ "source password to connect as the specified user. Alternatively, you can also specify the password by setting the environment variable SOURCE_DB_PASSWORD. If you don't provide a password via the CLI, yb-voyager will prompt you at runtime for a password. If the password contains special characters that are interpreted by the shell (for example, # and $), enclose the password in single quotes." )
93
+
94
+ cmd .Flags ().StringVar (& source .DBName , "source-db-name" , "" ,
95
+ "source database name to be migrated to YugabyteDB" )
96
+
97
+ cmd .Flags ().StringVar (& source .Schema , "source-db-schema" , "" ,
98
+ "source schema name(s) to export\n " +
99
+ `Note: in case of multiple schemas, use a comma separated list of schemas: "schema1,schema2,schema3"` )
100
+
101
+ // TODO SSL related more args will come. Explore them later.
102
+ cmd .Flags ().StringVar (& source .SSLCertPath , "source-ssl-cert" , "" ,
103
+ "Path of the file containing source SSL Certificate" )
104
+
105
+ cmd .Flags ().StringVar (& source .SSLMode , "source-ssl-mode" , "prefer" ,
106
+ "specify the source SSL mode out of: (disable, allow, prefer, require, verify-ca, verify-full)" )
107
+
108
+ cmd .Flags ().StringVar (& source .SSLKey , "source-ssl-key" , "" ,
109
+ "Path of the file containing source SSL Key" )
110
+
111
+ cmd .Flags ().StringVar (& source .SSLRootCert , "source-ssl-root-cert" , "" ,
112
+ "Path of the file containing source SSL Root Certificate" )
113
+
114
+ cmd .Flags ().StringVar (& source .SSLCRL , "source-ssl-crl" , "" ,
115
+ "Path of the file containing source SSL Root Certificate Revocation List (CRL)" )
116
+ }
117
+
77
118
func init () {
78
119
rootCmd .AddCommand (assessMigrationCmd )
79
120
registerCommonGlobalFlags (assessMigrationCmd )
80
- registerSourceDBConnFlags (assessMigrationCmd , false , false )
121
+ registerSourceDBConnFlagsForAM (assessMigrationCmd )
81
122
82
123
BoolVar (assessMigrationCmd .Flags (), & startClean , "start-clean" , false ,
83
124
"cleans up the project directory for schema or data files depending on the export command (default false)" )
0 commit comments