At the moment I've got 2 drupal 7 site. Now I want to merge those two sites together. If I export the user table in the database from one site and import the data directly into another site, will that be working? Btw, The users don't have any related contents like nodes or comments in the site so I guess the only table I need to worry about the user table. The only concern is the password. I'm not sure if I import the data the user password will be the same.
I can think of a few problems that might occur if you simply import the users table:
- Existing Users' IDs might overlap with the users to be imported (which would just give a SQL error about duplicate primary keys).
- No way to add roles to the imported users (if applicable).
- Imported Users' language might not exist on the new site.
- Imported Users' theme might not exist on new site.
- Likely many others
You're much better off using something like User Import to do this.
You need to use Drupal-to-Drupal data migration module. Project page says
"With migrate_d2d 2.1, we are introducing a wizard-based UI for defining your Drupal-to-Drupal migrations. Enabling the migrate_d2d_ui module will add an "Import from Drupal" subtab to the Migrate dashboard - visit that tab, enter the credentials for your source Drupal database (versions 5, 6, or 7), and follow the steps to define how your legacy content maps to the destination Drupal 7 site."