I'm having troubles migrating my company's data from Magento to Django Rest Framework [closed]
I observed that the SQL tables were not organised enough for a typical migration, so I decided to work on a new lighter DB and utilise Django because of its stability to handle the seeding of the new DB from the Magento DB through the API it provides.
The major tables I need for the new DB are:
- Products
- Categories
- Brands
- Customer Details
I have a script that successfully seeds categories and brands. I am yet to attempt Customer Details, and the major issue is that the products have images attached to them, and I am not sure how to do the migrations of images effectively. Also the categories are forgetting their parent category, reason is since they are all creating at the same time, the parent category ID will always return not found.
I created some scripts already, seed categories and seed brands fully functional. I created another sript to run all the necessary migrations too.
#!/bin/bash
set -e
GREEN='\033[0;32m'
RED='\033[0;31m'
RESET='\033[0m'
GAP="\n\n\n"
echo "Installing requirements..."
pip install -r requirements.txt
echo -e "${GREEN}Requirements installed!${RESET}${GAP}"
echo "Migrating database..."
python manage.py makemigrations
python manage.py makemigrations helpers api
python manage.py migrate
echo -e "${GREEN}Migration complete!${RESET}${GAP}"
echo "Seeding Image..."
python manage.py seed_image
echo -e "${GREEN}Default Image seeded!${RESET}${GAP}"
echo "Running Tests ..."
python manage.py test
echo -e "${GREEN}Tests complete!${RESET}${GAP}"
echo "Seeding categories..."
python manage.py seed_categories
echo -e "${GREEN}Categories seeded!${RESET}${GAP}"
echo "Seeding brands..."
python manage.py seed_brands
echo -e "${GREEN}Brands seeded!${RESET}${GAP}"
echo "Seeding products..."
python manage.py seed_products
echo -e "${GREEN}Products seeded!${RESET}${GAP}"
echo "Running server..."
python manage.py runserver