我需要從舊用戶數據庫遷移到新數據....但幸運的是,密碼和鹽字段的值在兩者上都是相同的,但列名是不同的(舊桌上:用戶passhash->祕密,在新表:新用戶密碼 - >鹽)生成帶有更改列名稱的MySQL插入
如何從我現有的用戶數據生成插入轉儲?每當我這樣做
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' ;
我可以看到在phpMyAdmin正確列出的值...但是,當我出口的結果,我看到在舊結構插入:
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....
更具體一點:在舊錶上:user passhash-> secret,在新表上:newuser password-> salt – Razvan 2012-07-11 16:48:08