MySQL DB Creation and Migration

  MySQL DB Creation & Migration

MySQL DB Creation and Migration



Collect DB Details:



DP DB_HOST:   10. 140. 162. 102

DP_DB_USER:   Deals_Procurement_Prod_User

DP_DB_PASSWORD:  xxxxxxxxxxxxxxxxxxxx

DP_DB_PORT:  3306

DB_NAME:    Deals_Procurement_Prod 



Step1. Go to GCP Portal:-


       ——> SQL

       ——> Java-qa-all-db-version-8

       ——> Database

       ——> Create database

                 Name     Deals_Procurement_Prod

                                       Create. 


Step2. Click on User:-

               

       ——> + ADD USER ACCOUNT:-

       ——> User_Name   — Deals_Procurement_Prod_User

         ——> Password       — XXXXXXXXXXXXXXXXXXX

                                                    

                                                    — ADD.

              


Step3. Go to Cloud Storage:-

       

          ——> Search bikes-backup, click on it.

        ——> Create folder

         ——> Name.                  —b2b-info-lead-prod-migration

                                                   Create. 


          ——> Now Upload files which is shared by client for data migration.




Step4. Go to SQL Overview Page:-


          —— Import

        —— choose folder

        —— select files

        —— SQL

        —— Destination     — Deals_Procurement_Prod

  Import.     


 Note: (here you need to select your database which has created by you).

                                                  

 



Step5. Go to Cloud Beaver:

       

       ——> Java-Prod-DB-Version-8

         ——> Database

       ——> SQL

       ——> Open

       ——> Give the access as per requirement.



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..




++++++++++++++++++++++++++++++++++++++


Export Data from the Old Instance: MySQL


Use the mysqldump or pg_dump command-line tools to export the data from the old instance.


For example, for MySQL, you can use a command like:

$ mysqldump -h [OLD_INSTANCE_IP] -u [USERNAME] -p [DATABASE_NAME] > dump.sql


For PostgreSQL, you can use a command like:

$ pg_dump -h [OLD_INSTANCE_IP] -U [USERNAME] -d [DATABASE_NAME] -f dump.sql




Import Data into the New Instance: MySQL


  • Once the data is exported, you can import it into the new instance.
  • For MySQL, you can use a command like:


$ mysql -h [NEW_INSTANCE_IP] -u [USERNAME] -p [DATABASE_NAME] < dump.sql



For PostgreSQL, you can use a command like:

$ sql -h [NEW_INSTANCE_IP] -U [USERNAME] -d [DATABASE_NAME] -f dump.sql


















We are migrating this service from 5.7 to 8.0


For new Db, please set below properties

DP_DB_HOST

DP_DB_USER

DP_DB_PASSWORD

DP_DB_PORT

DP_DB_NAME


For existing Db, please set below properties

DE_DB_HOST

DE_DB_USER

DE_DB_PASSWORD

DE_DB_PORT

DE_DB_NAME



























Previous
Next Post »