Skip to content

Commit 889d017

Browse files
authored
Merge branch 'main' into feature/git-remove-local-branches
2 parents 597c999 + 8036063 commit 889d017

2 files changed

Lines changed: 43 additions & 1 deletion

File tree

specs/sql/export_my_sql_dataabase_schema_without_exporting_its_data.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Export MySQL dataabase schema without exporting its data
2+
name: Export MySQL database schema without exporting its data
33
command: "mysqldump -h {{host_name_or_ip}} -u {{username}} -p --no-data dbname > {{output_sql_file_path}}"
44
tags:
55
- mysql
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Migrate from MySQL Database to PostgresSQL Database
3+
command: "pgloader mysql://{{mysql_username}}:{{mysql_password}}@{{mysql_hostname}}:{{mysql_port}}/{{mysql_database_name}} postgresql://{{postgres_username}}:{{postgres_password}}@{{postgres_hostname}}:{{postgres_port}}/{{postgres_database_name}}"
4+
tags:
5+
- postgresql
6+
- mysql
7+
description: Loads data from the MySQL database, transforms it to PostgresSQL compatible format and uploads it to the PostgresSQL database. Note - it requires pgloader to be installed and both PostgresSQL and MySQL hosts are accessible from the machine running this script.
8+
arguments:
9+
- name: mysql_username
10+
description: The username for the MySQL database.
11+
default_value: ~
12+
- name: mysql_password
13+
description: The password for the MySQL database.
14+
default_value: ~
15+
- name: mysql_hostname
16+
description: The hostname for the MySQL database.
17+
default_value: ~
18+
- name: mysql_port
19+
description: The port for the MySQL database.
20+
default_value: 3306
21+
- name: mysql_database_name
22+
description: The name of the MySQL database.
23+
default_value: ~
24+
- name: postgres_username
25+
description: The username for the Postgres database.
26+
default_value: ~
27+
- name: postgres_password
28+
description: The password for the Postgres database.
29+
default_value: ~
30+
- name: postgres_hostname
31+
description: The hostname for the Postgres database.
32+
default_value: ~
33+
- name: postgres_port
34+
description: The port for the Postgres database.
35+
default_value: 5432
36+
- name: postgres_database_name
37+
description: The name of the Postgres database.
38+
default_value: ~
39+
source_url: "https://docs.dipak.tech/database/postgres/postgres-migration"
40+
author: Dipak Parmar
41+
author_url: "https://github.com/dipakparmar"
42+
shells: []

0 commit comments

Comments
 (0)