Postgres Migration Tool: Step-by-Step Walkthroughs

Using PostgreSQL migration tool is crucial when you need to migrate PostgreSQL database to another server or completely change a platform (e.g. converting PostgreSQL to Microsoft SQL Server). Handy Backup software is both convenient and efficient solution for PostgreSQL database migration!


Free Download

Version 8.5.0, built on September 19, 2023
116 MB

PostgreSQL Migration

How to Use Handy Backup as PostgreSQL Migration Toolkit?

To migrate PostgreSQL database to a new server (in cases of homogeneous migration, where the source and target databases are of the same DBMS), you only need to follow two simple, fully automated steps:

  1. Create a full database backup.
  2. Upload database backup file to another PostgreSQL server.

Here you can find a short instruction on how to migrate PostgreSQL database with Handy Backup tool. For more detailed information on each step, please read the appropriate sections of the User Manual.


Creating a PostgreSQL Backup

You can easily migrate your PostgreSQL database to a new server with the help of PostgreSQL backup tool. First, you need to create a backup task. Please make sure, that your data storage device, where backup file is created (for example, your FTP server or external USB drive), has enough available space (at least for the time being!).

  1. From the menu bar at the top of the screen, go to File > New Task and choose a "Backup" task type. Select advanced mode for the advanced settings.

Tip: Advanced mode will take you through additional steps during installation and enable much more options in the user interface, including backup method, versioning, advanced scheduling, e-mail notifications etc. Such mode is probably useless for inexperienced users, however, still has an essential purpose for implementing high level backup strategies!

  1. On step 2 select PostgreSQL from the Database folder.
Select PostgreSQL from Databases
  1. Create a new PostgreSQL configuration for server migration if you still don′t have one.
  2. Click "Create a connection" and enter your PostgreSQL connection parameters in the dialog box.
Select PostgreSQL data for Backup
  1. Now you have a configuration to back up PostgreSQL. Select your configuration and choose migrating databases.
  2. Now go back to Step 3 and select a folder where you want to store your Postgres migration data.
  3. Proceed with creating a task with default parameters, according to your backup strategy. Here you can use such advanced parameters as differential and versioned backup on Step 4, scheduling and triggering a task on Step 6, and starting external software on Step 7.

Caveat: To take a snapshot for PostgreSQL migration, you must have a sufficient user privileges to use a PostgreSQL SELECT statement freely for creating a backup database dump.

Using a Backup Dump to Migrate PostgreSQL to a New Server

Next, you will need to create a new PostgreSQL restoration task to migrate Postgres database to another server. Please follow the instruction below:

  1. Create a new task and select restoration as a task type. Use advanced mode.
  2. On Step 2, select a backup location where you have saved your Postgres snapshot.
  3. Find a file backup.hbi, containing all data related to this particular backup. Click "Next".
Select PostgreSQL Restore Locations
  1. Click on the "Change Location" button. Select a new server to migrate PostgreSQL database.
  2. Click OK. Continue creating a task with default restoration parameters.

Note: Server Backup solution can perform both backup and restore operations needed for PostgreSQL migration on remote machines in the local network! In addition, single-machine editions like Small Business Backup software can also access remote databases.

Implementing a Postgres Database Migration Tool

Finally, you may migrate PostgreSQL to another server. In order to do so, start a backup task created in a previous instruction. After finishing this task, start a second part of the job – a restoration task. That is all! Your PostgreSQL migration will complete in fully automated mode!

An advice: Using the scheduling on the Step 6 of backup task (and the Step 4 or Step 5 of restore task), you can schedule your tasks to run automatically in an appropriate time (e.g. at evening after work hours). This can save you some time and efforts, although it may look a bit uncontrollable (or may not?).

Set PostgreSQL Mmigration Scheduling

How to Migrate PostgreSQL Database to a different database management system?

Migrating a PostgreSQL database to a new server with a different Database Management System (DBMS) requires a multi-step process. Since you′re migrating from PostgreSQL to a different DBMS, you′ll need to perform a conversion of the schema and data to the target DBMS′s format. You can migrate Postgres to SQL, Microsoft SQL or Oracle servers. Each of them has different specifications, however, here′s a general outline of the process

  1. Set up the new server: Install and configure the new DBMS on the new server. Ensure it′s compatible with your application and meets the necessary requirements.
  2. Understand the target DBMS: Familiarize yourself with the syntax, data types, and limitations of the target DBMS. This knowledge will be useful during the conversion process.
  3. Export the PostgreSQL schema: Use a tool like pg_dump to export the PostgreSQL database schema. This command generates a SQL script containing the schema definitions, table structures, constraints, and indexes.
  4. Convert the schema: Modify the exported PostgreSQL schema SQL script to match the syntax and structure of the target DBMS. This may involve changing data types, rewriting queries, and handling any incompatibilities between the two systems.
  5. Create the schema on the new DBMS: Execute the converted schema SQL script on the new DBMS to create the necessary tables, views, indexes, and other database objects.
  6. Export PostgreSQL data: Use pg_dump to export the data from the PostgreSQL database.
  7. Convert the data: Modify the exported data SQL script to match the target DBMS′s syntax and any necessary data conversions.
  8. Import data into the new DBMS: Execute the converted data SQL script on the new DBMS to import the data into the corresponding tables.

It′s important to note that the specific steps and tools may vary depending on the target DBMS you′re migrating to. Ensure you consult the documentation and resources provided by the DBMS vendor to understand the migration process in detail for your specific case.

Advantages of Handy Backup as PostgreSQL Migration Tool

Partial PostgreSQL Migration and Backup

Partial PostgreSQL Migration and Backup

With Handy Backup, you can take either full or differential backup for PostgreSQL migration, including an option of mixed full/differential backup in a cycled chain. It allows you saving much time and storage space during migrating routines.

Perfect Scheduler with Triggering by Events

Perfect Scheduler with Triggering by Events

Handy Backup allows not only performing PostgreSQL migration on a regular base, with a period between migration tasks starting from minutes to several months, but also triggering these tasks by some system event, such as logoff or inserting a task-related USB device into a server slot.

Free Download

Version 8.5.0, built on September 19, 2023
116 MB

Try how Handy Backup can automate moving a PostgreSQL database to another location or even to another DBMS (such as PostgreSQL to MySQL migration) by downloading and installing a freshest version of the program with all plug-ins available for a 30-day free trial!

Handy Backup compatibility was tested on PostgreSQL 15.1, 14.6, 13.9, 12.13 and 11.18.

0 comments

    Who uses our backup software?