I need to migrate from my old user DB, to a new one…. but luckily the value of the password and salt fields are the same on both, but the column name are different (on old table:user passhash->secret, on new table:newuser password->salt)
How do I generate an insert dump from my existing users-data? Whenever I do something like
SELECT id,
username,
LOWER(username) AS username_canonical,
email,
LOWER(email) AS email_canonical,
passhash AS 'password',
secret AS salt,
1 AS enabled,
'a:0:{}' AS roles,
0 AS credentials_expired,
0 AS expired,
0 AS locked,
uploaded,
downloaded,
torrent_pass,
0 AS torrent_pass_version
FROM
temp2.users AS fos_user
WHERE enabled = 'yes' ;
I can see the values correctly listed in phpMyAdmin…but when I export the results, I see inserts in the old structure:
INSERT INTO `fos_user` (`id`, `username`, `username`, `email`,
`email`, `passhash`, `secret`, `enabled`, `a:0:{}`,
`credentials_expired`, `expired`, `locked`, `uploaded`,
`downloaded`, `torrent_pass`, `torrent_pass_version`)
VALUES....
Why not do the INSERT and SELECT at the same time with something like this:
Of course this assumes that you can have the old dataset in the new database, at least temporarily…