EDIT: seems it’s not possible to keep the passwords.
Hi all,
I’m trying to port some old Express app (with MongoDB) to a Django app (with Postgresql).
I want to seed existing users from a JSON data file that was exported from a Mongo database it has some date/time stamps that I want to keep in the createdAt and updatedAt fields.
All users have passwords already encryption in bcrypt, Next, I want to preserve the _id in maybe some new old_id field to connect it to other data that need to be seeded to other tables later and also move all that extra data to a new profile model. I don’t even know If this is possible.
Here is a small sample of my JSON export data:
{
"RECORDS": [
{
"_id": "616224fec72679427a94b1ae",
"accountType": "Personal",
"businessName": "",
"businessType": "",
"defaultTip": "0",
"disableAccount": "false",
"email": "fakeemail1@gmail.com",
"firstName": "John",
"fullName": "John Doe",
"lastName": "Doe",
"password": "$2a$10$5n8iHFKcPAkpfxbR.JvLVu8auls7mPB0ckWRKwpDV8ZO0yPIDY7fe",
"paymentType": "Cash",
"phone": "(555) 444-5555",
"town": "Random Town",
"createdAt": "2021-10-09 23:25:50.0,422",
"updatedAt": "2021-10-09 23:27:41.0,095",
"zipCode": "90210"
},
]
}
Hope someone can help me with this like I don’t even know were to start I’m really new at Django but so sick and tired of JavaScript and my other option is use some PHP framework what is even worst!
Anyway thanks for even reading this far!