Title: Import users from non-wordpress database
Last modified: August 30, 2016

---

# Import users from non-wordpress database

 *  [iamdanieljs](https://wordpress.org/support/users/iamdanieljs/)
 * (@iamdanieljs)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/import-users-from-non-wordpress-database/)
 * I have a custom-made script, running a bookingsystem. I would like to have all
   the clients at the bookingsystem, automatic imported to my wordpress site as 
   normal users.
    At the bookingsystem all users are registred with a username, 
   email, frontname and lastname in a mysql database. Does a plugin with that ability
   already exist? I have been searching for hours now, but without luck.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [JosephNC](https://wordpress.org/support/users/ncej/)
 * (@ncej)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/import-users-from-non-wordpress-database/#post-6866949)
 * Hi iamdanieljs,
 * If your bookingsystem columns format are exactly like wp_users columns, it will
   be easier to migrate the data to wp_users table with some plugin; otherwise, 
   it won’t be easy.
 * If you can explain in full detail here; i will help you.
 * Or, you can post this issue in [WP Jobs](http://jobs.wordpress.net) Section and
   get a WP expert to do it.
 * Cheers.
 *  Thread Starter [iamdanieljs](https://wordpress.org/support/users/iamdanieljs/)
 * (@iamdanieljs)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/import-users-from-non-wordpress-database/#post-6867031)
 * Hi Ncej
    The users are stored in a table called eventbooking_clients… also the
   name of the columns are different from the once at the wordpress – But the content
   is almost the same… loginname, name, email, phone etc. Thanks 🙂
 *  [Bhavesh Patel](https://wordpress.org/support/users/go4glory/)
 * (@go4glory)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/import-users-from-non-wordpress-database/#post-6867045)
 * Hi iamdanieljs,
 * You can create your own script to handle this task. Its very simple task though.
 * You have to create custom database connection for fetching data from eventbooking_clients
   table
    Create one array namely users to get users data from eventbooking_clients
   table. Close this database connection after getting all the users in array.
 * //For Example
 *     ```
       foreach($users as $user){
          $user_id = username_exists( $user['user_name'] );
          if ( !$user_id and email_exists($user['mail']) == false ) {
             $random_password = wp_generate_password( $length=12,
                                $include_standard_special_chars=false );
             $user_id = wp_create_user($user['user_name'], $random_password,  $user['email']);
         } else {
           $random_password = __('User already exists.  Password inherited.');
         }
       }
       ```
   
 * If you want to do this task on regular basis(Example:execute a script on daily
   basis) than you can create one Cron job for it.
    Also you can manage this by 
   inserting one new column like last_updated date in eventbooking_clients table
   and fetch only required users.
 *  Thread Starter [iamdanieljs](https://wordpress.org/support/users/iamdanieljs/)
 * (@iamdanieljs)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/import-users-from-non-wordpress-database/#post-6867047)
 * Hi Bhavesh Patel
    Thanks for your answer – Do you think a script like this already
   exist? I have a little knowledge in php and mysql 🙁 Sorry… Thanks for your time
   so far!
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [10 years, 4 months ago](https://wordpress.org/support/topic/import-users-from-non-wordpress-database/#post-6867053)
 * [@go4glory](https://wordpress.org/support/users/go4glory/) I’ve deleted your 
   offer to login to your user’s site. I’m am 100% sure you mean well but please
   _never ask for credentials on these forums._
 * Now for the why: The internet is a wonderful place full of very nice people and
   a few very bad ones. I’m sure everyone here is very nice however, by giving some
   ones keys to your house you are trusting they wont steal anything. Likewise the
   person who takes the keys is now responsible for the house FOREVER.
 * If something was to go wrong, then you the author may well legally become liable
   for damages, which they would not normally have been as their software is provided
   without warranty.
 * Please be aware that repeatedly asking for credentials could result in being 
   banned from these forums.
 * [http://codex.wordpress.org/Forum_Welcome#The_Bad_Stuff](http://codex.wordpress.org/Forum_Welcome#The_Bad_Stuff)
 *  [Bhavesh Patel](https://wordpress.org/support/users/go4glory/)
 * (@go4glory)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/import-users-from-non-wordpress-database/#post-6867054)
 * Hello Jan Dembowski,
    Your are right. My intention was not bad and thanks for
   understanding it. Actually i don’t know about this rule. And surely this will
   not happen again. Thanks Jan Dembowski.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Import users from non-wordpress database’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [external](https://wordpress.org/support/topic-tag/external/)
 * [Import](https://wordpress.org/support/topic-tag/import/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [users](https://wordpress.org/support/topic-tag/users/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 6 replies
 * 4 participants
 * Last reply from: [Bhavesh Patel](https://wordpress.org/support/users/go4glory/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/import-users-from-non-wordpress-database/#post-6867054)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
