I already have an existing website running and want to transfer just the users (usernames, passwords and emails) to another database for a separate Django website as I am rebuilding it.
Asked
Active
Viewed 1,892 times
2
-
It would be useful to know the type of database/s you are using on the old and new platform – dtt101 May 18 '18 at 21:13
-
Do you use Django for both websites? – Peter Sobhi May 18 '18 at 22:01
-
Yes so the current website is still using dbsqlite 3 and I will be migrating to a MySQL database – Kareem May 18 '18 at 22:09
1 Answers
2
You can configure both databases in your django configuration file. select the user data from one database and then put the records in the other.

Gytree
- 542
- 3
- 13
-
The thing is I don't want to be using dbsqlite 3 anymore as it is just a development server and will still like to keep the users I have now is there not a way to do something like . python manage.py dumpdata users > users.json – Kareem May 18 '18 at 22:12
-
1But you don't need use only sqlite in your config. the database backend can be a PostgreSQL, so you can select the user data usin **users = get_user_model().object.using('default').all()** and then use **get_user_model().object.using('otherdb').bulk_create(users)** is Not what you're looking for? – Gytree May 18 '18 at 22:19
-
I dont quite understand what your trying to say, so what I do is I set up django to use both databases then run those commands in the django python shell then the users will exist on that databse – Kareem May 18 '18 at 22:23
-