Edit

Share via


New-AzDataMigrationSelectedDBObject

Creates a database input object that contains information about source and target databases for migration.

Syntax

MigrateSqlServerSqlDb (Default)

New-AzDataMigrationSelectedDBObject
    -SourceDatabaseName <String>
    -TargetDatabaseName <String>
    [-MigrateSqlServerSqlDb]
    [-MakeSourceDbReadOnly]
    [-TableMap <System.Collections.Generic.IDictionary`2[System.String,System.String]>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

MigrateSqlServerSqlDbMi

New-AzDataMigrationSelectedDBObject
    -SourceDatabaseName <String>
    -TargetDatabaseName <String>
    [-MigrateSqlServerSqlDbMi]
    [-BackupFileShare <FileShare>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The New-AzDataMigrationSelectedDB cmdlet creates a database info object that contains information about source and target databases, as well as the table mappings, for migration. This cmdlet can be used as a parameter with the New-AzDataMigrationTask cmdlet.

Examples

Example 1

New-AzDataMigrationSelectedDBObject -MigrateSqlServerSqlDb -Name "HR" -TargetDatabaseName "HR_PSTEST" -TableMap $tableMap
Name TargetDatabaseName MakeSourceDbReadOnly TableMap
---- ------------------ -------------------- --------
HR   HR_PSTEST                         False {[HR.COUNTRIES, HR.COUNTRIES]}

Example 2

New-AzDataMigrationSelectedDBObject -MigrateSqlServerSqlDbMi -Name "HR" -TargetDatabaseName "HR_PSTEST" -BackupFileShare $backupFileShare
Name RestoreDatabaseName BackupFileShare
---- ------------------- ---------------
HR   HRTest              Microsoft.Azure.Management.DataMigration.Models.FileShare

Parameters

-BackupFileShare

File share where the source server database files for this database should be backed up. Use this setting to override file share information for each database. Use fully qualified domain name for the server.

Parameter properties

Type:FileShare
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

MigrateSqlServerSqlDbMi
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MakeSourceDbReadOnly

Set Database to readonly before migration

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

MigrateSqlServerSqlDb
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MigrateSqlServerSqlDb

Set migration type to SQL Server to SQL DB Migration.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

MigrateSqlServerSqlDb
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MigrateSqlServerSqlDbMi

Set migration type to SQL Server to SQL DB MI Migration.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

MigrateSqlServerSqlDbMi
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SourceDatabaseName

The name of the source database.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Name

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TableMap

mapping of source to target tables

Parameter properties

Type:

IDictionary<TKey,TValue>[System.String,System.String]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

MigrateSqlServerSqlDb
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TargetDatabaseName

The name of the target database.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

FileShare

Outputs

MigrateSqlServerSqlDbDatabaseInput