How to carry over existing wp users to a new buddypress installation [closed]

The following plugin will make all WordPress users to appear on BuddyPress members directory. It doesn’t provide full migration of users, but it will update the last_activity user meta field that is used by BP to display users.

This is a plugin code, so you need to create a new php file (eg. bp-add-users.php) and upload it to plugins directory of your WP installation wp-content/plugins. When you activate the plugin it will update all users, after that you can deactivate and delete:

/*
Plugin Name:  BP User Updater
Description:  Update `last_activity` user meta for all users.
Author:       Ahmad M
 */

register_activation_hook(__FILE__, 'add_users_to_bp');

function add_users_to_bp() {

    $users = get_users();

    foreach ($users as $user) {
        update_user_meta($user->ID, 'last_activity', date("Y-m-d H:i:s"));
    }
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)