
This guide explains how you can migrate your AWS Cloud Database to Vultr with minimal downtime to the source database applications. Vultr's Managed Databases for PostgreSQL offer reduced costs, easy management and backups, scheduled updates, quick scaling, straightforward monitoring, and automated failover to replica nodes in case of database failures.
You can migrate your AWS source database to a Vultr Managed Database for PostgreSQL with the pg_dump command line tool or pgAdmin for a graphical migration process.
Before your start, make sure you:
0.0.0.0/0.pg_dumppg_dump is a Postgres backup utility tool that exports a single database to a script file. The pg_dumpall variant exports all databases along with any existing roles using the following syntax.
Verify that the pg_dump utility is available on your computer.
Output:
If unavailable, please install the postgresql-client tool.
Export your source database. Replace example with your actual database details.
When complete, verify that the file is available in your working directory.
Export the database roles.
Log in to your Vultr Postgres database.
Create a new database with the same name as your source database.
Exit the console.
Import database roles to your Vultr database.
Import the database to your target Vultr Postgres Database.
OR
pgAdminLog in to your pgAdmin interface.
Click Servers on the left navigation menu, and expand your source database server.
Expand Databases, and right-click your target database.
Click Backup from the drop-down list of options.
In the open popup, enter your desired filename for the database backup file.
Click the Format drop-down, and select tar from the list.
Set the encoding to UTF8 and select your Role name to export with the database.
Click Backup to start exporting your database and save it to your computer when complete.
To import the database to your target Vultr database, add a new Postgres server and fill in your Vultr database details in the connection tab.
When ready, expand your Vultr database server on the left navigation menu.
Right-click Databases, mouse over the Create option, and click Database to open a new pop-up window.
Enter a Database name that matches your source database, and click Save to create.
When created, right-click the new database and select Restore from the list of options.
In the open Restore (Database:) pop-up window, click the file icon in the Filename field to browse your exported database files.
Select your database user in the Role name field, then, click Restore to start importing your database. When complete, your source database and exported roles are ready to use with your new Vultr database.
Using the PostgreSQL psql client tool, log in to your Vultr Postgres database.
View available databases.
Switch to your target database.
Display tables in the database.
Verify that table data matches your source database.
Quit the psql client.
Depending on the applications using your source database, cut over requests to your new database by editing the application's configuration files. Please refer to your application's official documentation on how to edit your database connection settings.
In this article, you have migrated an AWS PostgreSQL database to a Vultr Managed Database. Depending on your database size, you can choose between the command line or graphical tools to safely migrate your database with no downtime to the applications using your database. For each migrated database, you can access logs and available databases through the Vultr Console. For more information about Vultr Managed Databases for PostgreSQL, see the Reference Guide
0 Comments
Be the first to comment and share your perspective with the community.