Move-IpamDatabase
Migrates the IPAM database to a SQL Server database.
Syntax
Default (Default)
Move-IpamDatabase
[-DatabaseServer] <String>
[-DatabaseName] <String>
[-DatabasePort] <UInt16>
-DatabaseAuthType <AuthType>
[-DatabaseCredential <PSCredential>]
[-PassThru]
[-Force]
[-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>]
[-AsJob]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Move-IpamDatabase cmdlet migrates the IP Address Management (IPAM) database to a Microsoft SQL Server database. You can migrate from Windows Internal Database (WID) or from a SQL Server database. The cmdlet creates a new IPAM schema and copies all data from the existing IPAM database. After the cmdlet completes copying data, it changes IPAM configuration settings to refer to the new database as the IPAM database. If you migrate from WID, the cmdlet renames the existing data and log files by appending a time stamp to the file names.
If the cmdlet cannot complete the migration for any reason, it returns an error and does not change the current database settings.
Verify that you can reach the database server from the IPAM server. Specify whether to connect to the destination server by using the account for the computer that hosts the IPAM server or by using a SQL Server database account. If you specify the IPAM server account, verify that the account has permissions necessary to write to the destination database. If the migration requires a new database, verify that the account has permissions to create and write to the database.
Use the Get-IpamDatabase cmdlet to view database configuration settings.
We recommend that you isolate the IPAM server and shut down all IPAM clients before you migrate a database.
The collation of the source and destination databases should be the same. If the destination database is not present, this cmdlet creates a new database using the default collation for the destination SQL Server. This might cause errors if the default collation of the source SQL database is different. To avoid this, use the following steps to manually create the destination database.
Moving from WID to an external SQL Server
Create the destination database on external SQL Server by using the following command:
CREATE DATABASE \[\<DBName\>\] COLLATE \<DB collation name\>
The parameter 'DB collation name' should be specified as SQL_LATIN1_GENERAL_CP1_CI_AS in this case.
Moving from one SQL Server database to another external SQL Server database
Read the collation of the existing database by using the following command:
SELECT collation_name FROM sys.databases WHERE name = N'\<DBName\>'
Create a new database on the destination SQL server by using the following command:
CREATE DATABASE \[\<DBName\>\] COLLATE \<DB collation name\>
Examples
Example 1: Move an IPAM database
This command uses the **Get-IpamDatabase** cmdlet to get the database configuration information. The console displays configuration information, including the type of database, WID.
PS C:\> Get-IpamDatabase
DatabaseType : WID
WidSchemaPath : C:\Windows\System32\IPAM\DataBase
DatabaseServer :
DatabaseName : IPAM
DatabasePort :
DatabaseAuthType : Windows
DatabaseUser :
This command moves the IPAM data to a database named IpamDB1 on the server named ContosoDB22. The database uses port 1433. The command specifies Windows as the authentication type, so the command uses credentials for the IPAM server. The cmdlet prompts you for confirmation.
PS C:\> Move-IpamDatabase -DatabaseServer "ContosoDB22" -DatabaseName "IpamDB1" -DatabasePort 1433 -DatabaseAuthType Windows
Confirm
This command will migrate IPAM data to the specified MsSql Database. The cmdlet will create a new Ipam Schema, copy the data and configure IPAM to use the new database. Once this migration is completed successfully, you will not be able to revert to using Windows Internal Database. Do you want to continue?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
This command uses the **Get-IpamDatabase** cmdlet to get the database configuration information. The console displays configuration information, including the type of database, WID. The console displays configuration information, including the type of database, now MSSQL. The database now has values for **DatabaseServer**, **DatabaseName**, and **DatabasePort**, as specified in the second command.
PS C:\> Get-IpamDatabase
DatabaseType : MSSQL
WidSchemaPath :
DatabaseServer : ContosoDB22
DatabaseName : IpamDB1
DatabasePort : 1433
DatabaseAuthType : Windows
DatabaseUser :
This example moves an IPAM database to a database named IpamDB1 on a database server named ContosoDB22.
Parameters
-AsJob
Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.
The cmdlet immediately returns an object that represents the job and then displays the command prompt.
You can continue to work in the session while the job completes.
To manage the job, use the *-Job
cmdlets.
To get the job results, use the Receive-Job cmdlet.
For more information about Windows PowerShell background jobs, see about_Jobs.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-CimSession
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.
Parameter properties
Type: | CimSession[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | Session |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: | SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | cf |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-DatabaseAuthType
Specifies which type of authentication to use to connect to the computer that runs SQL Server. The acceptable values for this parameter are:
- SQL. Use the database account. Specify this credential by using the DatabaseCredential parameter.
- Windows. Use the account for the computer that runs the IPAM server.
Parameter properties
Type: | AuthType |
Default value: | None |
Accepted values: | Windows, SQL |
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 |
-DatabaseCredential
Specifies credentials, as a PSCredential object, for the computer that runs SQL Server.
To obtain a PSCredential object, use the Get-Credential cmdlet.
For more information, type Get-Help Get-Credential
.
Specify this parameter if you specified a value of SQL for the DatabaseAuthType parameter.
Parameter properties
Type: | PSCredential |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-DatabaseName
Specifies the name of a SQL Server database. The cmdlet migrates the IPAM database to this database. If the database does not exist, IPAM creates a database that has this name on the destination server.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 2 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-DatabasePort
Specifies the port that the IPAM server uses to connect to the database server.
Parameter properties
Type: | UInt16 |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 3 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-DatabaseServer
Specifies the fully qualified ___domain name (FQDN) or IP address of the database server. The cmdlet migrates the IPAM database to this server.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 1 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Force
Forces the command to run without asking for user confirmation.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-PassThru
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ThrottleLimit
Specifies the maximum number of concurrent operations that can be established to run the cmdlet.
If this parameter is omitted or a value of 0
is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer.
The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Parameter properties
Type: | Int32 |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
Type: | SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | wi |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
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.