While transferring your WordPress website you need to copy your files and database and modify the wp-config.php file in your main WordPress folder.
In wp-config.php you need to change the below MySQL settings:
DB_NAME - here you should enter the database name of WordPress.
e.g: define('DB_NAME', 'user_wp1');
DB_USER - here you should enter the WordPress username with privileges to access the database. e.g.: define ('DB_USER', 'user_wp1');
DB_PASSWORD – here you should enter the password for accessing the database:
e.g: define ('DB_PASSWORD', '********');
DB_HOST - the MySQL host; in most cases you won't have to change this:
e.g.: define ('DB_HOST', 'localhost');
In case you wish to use the transferred application with another domain, or in another folder, you should also change the siteurl and home url options in phpMyAdmin of your WordPress database.
You can do this by login to phpMyAdmin, select your WordPress database and go to the table wp_options. Find the options siteurl and home url and change their values to the desired URL.