Sqlserver2pgsql is an open source ( GPL v3) tool specifically designed to migrate data from Microsoft SQL Server to PostgreSQL. In this post Microsoft SQL Server will serve as the source database where we’ll be migrating data from. Microsoft SQL Server is a relational database management system from Microsoft and Azure SQL Database is a flavor of Microsoft SQL Server optimized for the cloud. Since the database migration process will be migrating live data between the source and target databases, we’ll need to make sure that our Docker container will have network connectivity to both databases. What is Microsoft SQL Server / Azure SQL?Įxport schema using MS SQL Server Management Studio You’ll also find a link to the source code at the end of this post. With the goal of automating the process as much as possible, this post will describe the steps needed to create a Docker image to run the data migration using sqlserver2pgsql.įirst, we’ll take a look at the different tools and services used in the database migration process in this post and then go into the weeds of the actual migration. While ORM tools such as Hibernate for Java may make it a smooth transition, in some cases the database migration may require a substantial amount of code rewrite and testing effort. When migrating a database, make sure to also consider the source code changes needed to support the migration. For those scenarios consider using tools like Debezium, Kafka Connectors, etc. Please note that sqlserver2pgsql does not migrate any stored procedures.Īlso, sqlserver2pgsql may be great for one off database migrations, but it’s not suitable for use cases that require continuous data synchronization between the source and target databases for an extended period of time. There are also other tools on the market that can migrate the data, but not the schema, and would still rely on a tool like sqlserver2pgsql for that part. Unfortunately, that tool seems to have an issue connecting to Azure SQL, where the client’s Microsoft SQL Server instances were running and we did not get a chance to evaluate it for this use case. Alternatively, the open-source pgloader may be another option, too. In this post we’ll explore the database migration steps using the open-source sqlserver2pgsql tool. Once the process is automated it can be easily applied to different database instances across the organization. Since we want to minimize outages and the possibility of data loss/disruption, it’s best to minimize any manual activity and human error and also to automate the data migration process as much as possible. We recently worked with a client to help them with their cloud migration and with exploring options to migrate data from Microsoft SQL Server to PostgreSQL.ĭata migration for existing applications is one of the key aspects to consider as part of cloud migrations.
0 Comments
Leave a Reply. |