User Location/Country Issue for v1.6 RC1

For those that have upgraded to version 1.6 RC1, there is an issue reported here which in short is an ongoing issue with the upgrade routine that will create false data for a users “location” setting. This issue has been resolved for the next release, however for those that are running version 1.6 RC1 now, we will need a fix before the next release is out.

I have created a patch here that is still under testing but has passed the recent tests and was able to fully fix the invalid user “location” issue. The last test was done on a clients live site with over 12k users.

However before I would like to release it publicly as “stable”, I would like to ask if anyone running version 1.6 RC1 and facing the issues I have mentioned here give the patch a try and report your outcome. If you are running a clean install of v1.6 RC1 then you are not facing this problem and won’t have to install this patch.

Ok, so on with the patch. Before we can install this patch we will need a backup for your old “user” table. This can be found from your old site backup, which should have been created before the upgrade to version 1.6 RC1. With your old site backup you will have to import the entire backup or just the “user” table into a new database on the same server where you have your current v1.6 RC1 running. This step is not the easiest but is crucial in order to fix this problem. There are numerous ways to import a database so it would take rather long to explain them, so the best thing is if you have questions feel free to ask. Please also add how you exported “backed up” your database, I or someone else here will then be able to guide you on how to import your database. Note that the import of your old “backed up” database should be placed in a new database and not the same one you currently have v1.6 RC1 installed in.Once you have completed the above task follow the steps below to complete the install of this patch:

1) Download the zip package here.

2) Unzip the package and you should find the PHP file: importUsers.php

3) Open importUsers.php with your favorite PHP or Text Editor.

Look for the following:

// Database Host
define("db_host", 'localhost');
 
// Database Username
define("db_user", '');
 
// Database Password
define("db_pass", '');
 
// Database name
define("db_name", '');

Edit the settings mentioned above so you are able to connect to your sites database.
Important: The “db_name” setting must be the database of where your old “backed up” user table is located and not your live v1.6 RC1 database.
Once that is done save and close the file.

4) Upload the PHP file “importUsers.php” to your server and place it in the folder: plugins/

5) Now you will have to run the PHP file via your web browser. So point your favorite web browser to:
http://www.yoursite.com/plugins/importUsers.php

The mini “install” script comes with 3 steps.

  1. Info about the install script.
  2. Create backup table and import old user details.
  3. Update user table with correct country ID#.

The 3rd step is your final step and can take a long time if you have a lot of users (5k+). Once the script is done it will let you know and once it does your site should be updated with the correct country ID#.

If you have the time to run this patch please report your outcome.

Thanks for your time!