Skip to content

Old Plans for Data Migration

Ryan Hodges edited this page Oct 18, 2017 · 1 revision

Audience: Developers looking to script and automate data migration between these technologies

#importing .SQL file from command line into MySQL

*in command line navigate to where MySQL is installed and then go to bin folder C:\Program Files\MySQL\MySQL Server 5.7\bin *First we need to create an empty database to import the sql in. type in mysql -u 'root' -p then press enter Then type in your mysql password, this will bring you into mysql command. Now create database with the following command. CREATE DATABASE mtked_db; This will create mtked db. Copy your sql file into C:\Program Files\MySQL\MySQL Server 5.7\bin *Now go back to your c: in command prompt and navigate to bin folder C:\Program Files\MySQL\MySQL Server 5.7\bin

  • Then type in the query mysql -u 'username' -p database_name <filename.sql. Press enter (username is the mysql username which is 'root', database_name is your newly created db name, filename is the actual name where file is located). Now it will prompt for your mysql root password- type in your password

You can now view the database in MySQL in workbench

##Software requirements

  • MySQL or PostgreSQL or other free DB tool that can be run via command line for scripting needs (specify)
  • Django (No need to lay out steps to install, those should be in the Schema docs or left to people to dig up online)
  • Others?

##Installing Software

  • if there are any tricky spots

##Preparing the environment

  • Absolute location of Access DB File
  • Absolute location of the Database (if needed)
  • Others?

##Commands to run

  • connect the databases
  • run a SQL script?
  • Single SQL commands?

##Notes for sorting software capabilities (before getting in to command-line options)

In all cases, start with an existing database with the schema loaded, generated by a Django project from the 'models.py' file you created in the converting databases process.

###MySQL

  • ways to pull data into existing schema (if possible)
    • Do any of these take less than 4 steps?
    • What is easiest?
    • What can we do to streamline this?

###PostgreSQL

  • Ways to pull data into existing schema (if possible and MySQL fails)
    • Do any of these take less than 4 steps?
    • Which is easiest?
    • What else can we do to streamline this?

###Breaking process down to command-line commands

  • Notes
Clone this wiki locally