New-AzureRmDataMigrationSelectedDBObject

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

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

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

Description

The New-AzureRmDataMigrationSelectedDB 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-AzureRmDataMigrationTask cmdlet.

Examples

Example 1

PS C:\> New-AzureRmDataMigrationSelectedDB -MigrateSqlServerSqlDb -Name "HR" -TargetDatabaseName "HR_PSTEST" -TableMap $tableMap

Name TargetDatabaseName MakeSourceDbReadOnly TableMap
---- ------------------ -------------------- --------
HR   HR_PSTEST                         False {[HR.COUNTRIES, HR.COUNTRIES]}

Example 2

PS C:\> New-AzureRmDataMigrationSelectedDB -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.

Type:Microsoft.Azure.Management.DataMigration.Models.FileShare
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MakeSourceDbReadOnly

Set Database to readonly before migration

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MigrateSqlServerSqlDb

Set migration type to SQL Server to SQL DB Migration.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-MigrateSqlServerSqlDbMi

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

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SourceDatabaseName

The name of the source database.

Type:String
Aliases:Name
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-TableMap

mapping of source to target tables

Type:IDictionary<TKey,TValue>[System.String,System.String]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TargetDatabaseName

The name of the target database.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Azure.Management.DataMigration.Models.FileShare

Outputs

Microsoft.Azure.Management.DataMigration.Models.MigrateSqlServerSqlDbDatabaseInput