You can import databases to a bastion host and perform O&M and audit operations on the databases using the bastion host. The databases include ApsaraDB RDS for MySQL, ApsaraDB RDS for SQL Server, and ApsaraDB RDS for PostgreSQL instances, PolarDB for MySQL, PolarDB for PostgreSQL, and PolarDB for PostgreSQL (Compatible with Oracle) clusters, and self-managed MySQL, SQL Server, PostgreSQL, and Oracle databases.
Supported versions
Enterprise Edition and SM Edition.
If your Bastionhost instance is Basic Edition, you need to upgrade to the corresponding version. For more information, see Upgrade instance type.
Import the databases within the current Alibaba Cloud account
You can import the databases within the current Alibaba Cloud account to a bastion host. Then, you can use the bastion host to perform O&M operations on the databases. The following section describes the supported database types and how to import the databases to a bastion host:
Import ApsaraDB RDS instances
Perform the following steps to import the ApsaraDB RDS for MySQL, ApsaraDB RDS for SQL Server, and ApsaraDB RDS for PostgreSQL instances within the current Alibaba Cloud account to a bastion host:
Log on to the Bastionhost console and select the region where your bastion host is deployed in the top navigation bar.
In the bastion host list, find the target instance and click Manage.
In the left-side navigation pane, choose .
On the Database page, choose .
In the Select Region dialog box, select the region of the ApsaraDB RDS instances that you want to import and click OK.
In the Import ApsaraDB RDS Databases dialog box, select the ApsaraDB RDS instances that you want to import and click Import.
Import PolarDB clusters
You can perform the following steps to import the PolarDB for MySQL, PolarDB for PostgreSQL, and PolarDB for PostgreSQL (Compatible with Oracle) clusters within the current Alibaba Cloud account to a bastion host:
Log on to the Bastionhost console and select the region where your bastion host is deployed in the top navigation bar.
In the bastion host list, find the target instance and click Manage.
In the left-side navigation pane, choose .
On the Database page, choose .
In the Select Region dialog box, select the region of the PolarDB clusters that you want to import and click OK.
In the Import PolarDB for Xscale Database dialog box, select the PolarDB clusters that you want to import and click Import.
Import the databases of members
Bastionhost allows you to manage the assets within multiple accounts centrally. If you have multiple Alibaba Cloud accounts, perform centralized O&M operations on the assets within these accounts using a bastion host based on Resource Directory.
To import the databases of a member to your bastion host, you must add the member to the bastion host first. For more information, see Use the multi-account management feature.
Import ApsaraDB RDS instances
You can perform the following steps to import the ApsaraDB RDS for MySQL, ApsaraDB RDS for SQL Server, and ApsaraDB RDS for PostgreSQL instances of a member to a bastion host:
Log on to the Bastionhost console and select the region where your bastion host is deployed in the top navigation bar.
In the bastion host list, find the target instance and click Manage.
In the left-side navigation pane, choose .
On the Database page, choose .
In the Select Alibaba Cloud Account step, select an account and click Next.
In the Select Region step, select a region and click OK.
In the Import ApsaraDB RDS Databases dialog box, select the ApsaraDB RDS instances that you want to import and click Import.
Import PolarDB clusters
You can perform the following steps to import the PolarDB for MySQL, PolarDB for PostgreSQL, and PolarDB for PostgreSQL (Compatible with Oracle) clusters of a member to a bastion host:
Log on to the Bastionhost console and select the region where your bastion host is deployed in the top navigation bar.
In the bastion host list, find the target instance and click Manage.
In the left-side navigation pane, choose .
On the Database page, choose .
In the Select Alibaba Cloud Account step, select an account and click Next.
In the Select Region step, select a region and click OK.
In the Import PolarDB for Xscale Database dialog box, select the PolarDB clusters that you want to import and click Import.
Import databases from other sources
Import a self-managed MySQL, SQL Server, PostgreSQL, or Oracle database to a bastion host by configuring the database information in the console of the bastion host. You can also import multiple databases to a bastion host at a time using a file. Bastionhost provides template files in XLS, CSV, and XLSX formats. You can download a template file, enter the database information, and then upload the file to import multiple databases to a bastion host at a time.
Import a self-managed database
Log on to the Bastionhost console and select the region where your bastion host is deployed in the top navigation bar.
In the bastion host list, find the target instance and click Manage.
In the left-side navigation pane, choose , and choose .
In the Create Database panel, configure the Database Instance Name, Protocol, Database Address, and Service Port parameters. Then, click Create.
After the database is created, you can click Add Account to create a database account for the database. You can also click Back to List to view the database in the database list.
Import multiple databases using a file
Log on to the Bastionhost console and select the region where your bastion host is deployed in the top navigation bar.
In the bastion host list, find the target instance and click Manage.
In the left-side navigation pane, choose , and choose .
In the Import Database panel, click Download Database Template. After the template package is downloaded, decompress the package, open the Excel template file, and then enter information about the databases based on the requirements of the template file. Then, save the changes to the file. Click Upload to upload the Excel file.
ImportantIn a template file, you must specify the Database Address field. If you set the Protocol field to PostgreSQL for a database, you must also specify the Database (PostgreSQL) field. If you do not specify a required field, the bastion host does not import the database.
In the Databases to Be Imported dialog box, select the databases that you want to import and click Import.
In the Import Database panel, click Import Database.
The databases that you want to import are displayed in a table. If some databases have the same name, the bastion host imports only the last database of the same name in the table. For example, if the first database, the third database, and the fifth database have the same name, only the fifth database is imported. If a database that you want to import has the same name as an existing database in the bastion host, the bastion host does not import the database. You can click Details in the Import Database panel to view the information about the databases that are not imported.
What to do next
After a database is imported to a bastion host, you must add an account for the database. Then, O&M engineers can use the account to log on to and perform O&M operations on the database. For more information, see Add and manage database accounts.
References
After importing a database to a bastion host, you can modify the information about the database, modify the O&M address of the database, or remove the database from the bastion host. For more information, see Manage databases.