Migration User Data From Wordpress Table to Laravel MySQL User Table - mysql

I am trying to migrate data from wordpress WP_Users table to Laravel MySQL Table. The problem is the Password field in WP_USERS use MD5 encryption whereas Laravel uses hash to store password. Is there a way/ tool to convert MD5 to Hash so that I can seamlessly migrate data from my old Wordpress app to New Laravel App? I am using Laravel Breeze

No - You will need to change the login function to check the insecure md5, then as people log in, save it as an encrypted password in Laravel.
Add a field on the user table called old_insecure_password where you store the old WordPress password.
Change the login function first to check login using the Laravel encryption. If it fails, it should check if the password matches the old_insecure_password using the same md5 from WordPress. If it does, it should take that password and encrypt it into the password field, clear out the old_insecure_password, and continue to log in.
Or migrate it and force everyone to reset their password.
Feel free to edit your question as you get stuck on something concrete when trying out this process, and ping me here if you have any additional questions.

Related

How to add an administrator with bcrypt password encryption in phpmyadmin or edit existing admin user bcrypt encrypted password?

I have encountered a problem in my sql script. I bought an sql script online and I'm trying to work around the script but I can't add another admin to the database and I can't edit the admin password as well because it's encrypted with bcrypt. Hope you understand me up to this point?
Below is the code in the script that generates the bcrypt upon registration but unfortunately, the php script has no admin registration page.
'acct_password' => password_hash((string)$acct_password, PASSWORD_BCRYPT)
I tried editing the password from the sql database but the plaintext is not working because when I try to login the login fails. I have done everything I can but I guess I have no idea working around bcrypt. Please can any help me solve this problem? Please if you don't understand me, kindly ask and I will explain further.
Can you create a little CLI Script like this
<?php
$plain_text_pwd = 'EnterYourNewPaswordHere';
echo password_hash($plain_text_pwd, PASSWORD_BCRYPT);
It will output a string like
$2y$10$joZ9wTiOxd2WiYlr6XMJouHD5J.D6mwmhhJEBUPoak4ZfjB74Dx6e
Then you just copy that into a simple query that will UPDATE the password column for this user account on your db.
Just guessing here
UPDATE user
SET acct_password = '$2y$10$joZ9wTiOxd2WiYlr6XMJouHD5J.D6mwmhhJEBUPoak4ZfjB74Dx6e'
WHERE id = 1;
Now the password you enter will be whatever YOU put in $plain_text_pwd in the above code

Different databases per user account after login in CakePHP

I want to create separate databases for different registrations.
First i was doing it via multiple sub-domain manually but now i want it to be automatic after registration when anyone sign up.
This is what am thinking to implement:
First i'll create a common database "user_databases" to just store "user email" and "user database name". So when any user login with his email then i will fetch its database name and then verify login password from users table of the fetched database.
But the problem is how will i achieve it?
Should i include the code in database.php of Config or in each model i use $useDbConfig (i don't want to use it due to some reasons)?
Are there any better methods for it? Am i thinking right to implement it?
Please help and guide.
database partitioning in cakephp is now a trivial task because of cake's event system. cakephp allows you to talk to its request and response objects early in the app startup process in form dispatch filters. markstory has written nicely about this http://mark-story.com/posts/view/using-cakephp-and-a-horizontally-sharded-database

Convert wordpress password to BCrypt-based

I have an old project which is using Wordpress, currently we create a new project and need to migrate the user's data into the new database (also Mysql).
The new database is using Bcrypt for encoding password for users. The old encode type in wordpress is like:
$P$BdsGKKQnnH6mi9hznpibst1jl/6G4z1
I think it might be MD5-based or not. I looked this link: http://stackoverflow.com/questions/1045988/what-type-of-hash-does-wordpress-use
I want to find a way to convert this type of password to Bcrypt-based. Maybe mysql script could help me convert? Can anyone give me some suggestions? Thanks.
I dont know if you can login to the admin panel or not. Chances are that you cant, but if you can somehow reset the password field with a known bCrypt hash for the admin. Then you can use this plugin to change the encryption from md5 to bcrypt for all your passwords.
https://wordpress.org/plugins/wp-bcrypt/

Decrypt and move rc4 encrypted password to Wordpress wp_user table?

I have RC4 encrypted data stored in a MySQL table that I need to move to the wp_user table and store as a Wordpress encrypted password. These are passwords so I'd prefer to move them securely, but I'm open to any suggestion.
This data was originally stored from a custom built Wordpress user management plugin that we've lost the developers for. Now we are attempting to move the users over to a Wishlist Member solution which stores them as regular wordpress users. I want to be able to change out the system without having to ask all the users to reset their passwords.
The old user data is encrypted as a hashed password concatenated with the encryption key. Below is the code sample that decrypts the secure data. I have the encryption key,
$secure_data = unserialize(
rc4crypt::decrypt(
$this->data->password . OLD::ENCRYPT_KEY,
$this->data->secure_data)
);
Any suggestions on how can I move this data into user_pass of wp_users?

MS Access Database update

I have an application which uses ms access database with password encryption. The login information is stored within the database (username and password). I double clicked the database file and keyed in the password to see the table list. In a message bar there's a massage stating that the "This database has been opened read-only". Then I tried to set the password into a new value lets say "password1". However, when I re run my application and tried to login using the new password but it fails (only works with the old password).
Does this mean the database here is not used by the application? Or there's a copy of the database somewhere and being referred to ?
I think there may be a password encryption, In this case you can not just modify the password in the database to login. Check your application.
The various things you say are incompatible with each other. Saving a database with encryption does not require a user name, only a password. If you get the password wrong or do not supply it, the database does not open read-only, it does not open at all. If you are using user level security, the user name and password are not stored "within the database", they are stored in an .mdw file.
Try holding the shift key down while you open the database, you must keep it held until the database if fully open, that is, hold the shift key, open the database, type in the password, continue to hold the shift key.
If you are not asked for a password when you hold the shift key, but the file is still read only, check:
Right-click the file and check the properties
Check the folder permissions
If there is a left over .ldb or .laccdb lock file