Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8216999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:19:44+00:00 2026-06-07T12:19:44+00:00

I need to migrate from my old user DB, to a new one…. but

  • 0

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....
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T12:19:46+00:00Added an answer on June 7, 2026 at 12:19 pm

    Why not do the INSERT and SELECT at the same time with something like this:

    INSERT INTO `fos_users` (username, password, salt ...)
    SELECT LOWER(username), passhash, secret, ...
    FROM users;
    

    Of course this assumes that you can have the old dataset in the new database, at least temporarily…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new to Python, but I need to migrate a project from PHP
I need to migrate data (varbinary(max)) from one table to another. When executing an
I need to migrate some data from access to sql. access has one table:
I need to migrate from one Mac to another, and want Sublime Text 2
I need to migrate data from a Plone-based portal to Liferay. Has anyone some
I need to migrate our SharePoint farm to a new domain. Until everything is
I am trying to migrate some code from an old naming scheme to the
We need to migrate our database from MSSQL to Oracle and we have over
I'm trying to write Linq-To-SQL queries in LinqPad to help migrate users from old
I am rebuilding a web application from an old one with many inconsistencies. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.