Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/datpmt/mysql_to_psql
MySQL to PostgreSQL Data Transfer
https://github.com/datpmt/mysql_to_psql
Last synced: about 1 month ago
JSON representation
MySQL to PostgreSQL Data Transfer
- Host: GitHub
- URL: https://github.com/datpmt/mysql_to_psql
- Owner: datpmt
- License: mit
- Created: 2024-04-11T15:47:02.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-04-11T16:09:54.000Z (9 months ago)
- Last Synced: 2024-04-11T19:07:59.131Z (9 months ago)
- Language: Ruby
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MySQL to PostgreSQL Data Transfer
This repository contains scripts to facilitate the transfer of data from a MySQL database to a PostgreSQL database. The process assumes that both databases share a common schema, including migrations in MySQL.
## Prerequisites
Before using the scripts, ensure the following prerequisites are met:
1. **MySQL Database**: Set up and populate a MySQL database with the desired schema and data.
2. **PostgreSQL Database**: Create an empty PostgreSQL database with the same schema as the MySQL database. Ensure that the schema includes all necessary tables and columns.
3. **Migrations**: Make sure that any necessary migrations for the MySQL schema are also applied to the PostgreSQL schema.## Usage
1. **Clone the Repository**: Clone this repository to your local machine.
```
git clone [email protected]:datpmt/mysql_to_psql.git
```2. **Configure Connection Settings**: Open the `copy.rb` file and update the connection settings for both MySQL and PostgreSQL databases.
3. **Transfer Data**: Run the provided script to transfer data from MySQL to PostgreSQL.
```
ruby copy.rb
```This script will connect to both databases, fetch data from MySQL, and insert it into PostgreSQL.
## Additional Notes
- Make sure both databases are accessible from the machine where the script is being run.
- It's recommended to run the transfer script in a controlled environment to avoid any unintended data loss or corruption.
- Depending on the size of the data, the transfer process may take some time to complete. Monitor the script for any errors or warnings during execution.## Contributors
- [datpmt](https://github.com/datpmt)
## License
Copyright (c) 2021 datpmt.
This project is licensed under the [MIT License](LICENSE).