Migration of tables from external database to new database

29 views
Skip to first unread message

Adekola Aderonmu

unread,
Mar 20, 2023, 3:12:20 AM3/20/23
to django...@googlegroups.com
Hi guys, 
I have an external  database with a particular table, and I want this table to be on my new database. How do I go about the  migration  of the table from the external database into the new  database?

THANK YOU

nef

unread,
Mar 20, 2023, 3:20:16 PM3/20/23
to Django users
Hi Adekola,
Can you provide more details?
Which database engine are you using? Version? Is your table have data or do you want to migrate the structure...?
How this is related to Django?
Thanks

Adekola Aderonmu

unread,
Mar 20, 2023, 4:19:35 PM3/20/23
to django...@googlegroups.com
Hi, my engine is mysql 
Yes, there is data in the table  I want to migrate into the new database.

CUS THE DATABASE  I WANT TO MIGRATE TOO IS AN APP IN DJANGO

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4c726045-a3d5-4667-ad7e-1e732085f922n%40googlegroups.com.

nef

unread,
Mar 21, 2023, 2:17:50 AM3/21/23
to Django users
Hi,
My suggestion is to first create the apps using Django, then create the models respecting the database structure you are willing to migrate, run the makemigrations, migrate which will create a new database with tables having the same structure as those you want to migrate.
After that, use the phpmyAdmin or what other tools you have to migrate your data from the old database to the new database 
I hope it helps.
Thanks
Nef

Brian Carey

unread,
Mar 21, 2023, 6:55:28 AM3/21/23
to django...@googlegroups.com
mysqldump can be used to extract the table(s) from the old database. This creates a file with the SQL statements to recreate the table which can be read into into the new database with mysql command. As long as you are going from a MySQL DB to another this will work fine. If you are moving from one engine to another there are potential problems but not necessarily.

Reply all
Reply to author
Forward
0 new messages