How to Migrate Users from Joomla 1.5 to Joomla 2.5

Some websites don’t have that much content – but they do have a lot of users. Such websites include charity websites, political websites, and some subscription websites. For these websites, it makes more sense to re-create the website from scratch in Joomla 2.5 (instead of migrating from Joomla 1.5 to Joomla 2.5 – which can be a costly and a length process) and then re-create the content on the new website.

Since the content is usually scarce, then re-creating the website is not usually a problem. However, re-creating its users can be a problem when there are many, so these users should be automatically migrated.

There are two ways to migrate users from Joomla 1.5 to Joomla 2.5:

  1. The easy and error prone way
  2. The advanced and efficient way

The easy way consists of installing an extension called userport (try googling “userport joomla”) on the old (Joomla 1.5) website and the new (Joomla 2.5) website. This extension will allow you to export your users from your old website to a CSV file and then import them in the new website.

Although this seems to be like an easy task – it’s usually not a smooth experience, here’s why:

  • CSV files are not a good way for exporting and importing sensitive data – this is because the data’s integrity can be affected when it contains the CSV separator (which can be a comma, a semi column, or a tab). It is very rare not to have this problem especially if the number of users being imported is large.
  • The ids of the users in the old database will not be preserved – they will be lost during the import process. This means that associations with other areas may be broken post-migration.

  • If two users have the same name, then the import will fail, generating the following the message: “Failed to update contact: COM_CONTACT_WARNING_SAME_NAME” Error on Joomla

The userport extension does work from time to time, but from our experience, it is better not to use it and follow the hard way to migrate your users to Joomla 2.5.

So, how do you migrate users the hard (and more efficient and less error prone) way?

The hard way consists of migrating users using phpMyAdmin. Since we have done this many times already, we have written a guide that can help anyone with some technical experience to do this migration himself. We have decided to share this guide on the itoctopus website:

  1. Export the users from the old jos_users table

    The export of the users should be done the following way:

    1. Run the following query in the SQL tab in phpMyAdmin:

      SELECT `id`,`name`,`username`,`email`,`password`,`block`,`params` FROM `jos_users` WHERE 1 AND id != 62;

      The above query will get all the users’ information from the old table (we excluded the user with the id 62 because it’s the default super administrator on Joomla 1.5 and we already have a super administrator on Joomla 2.5).

    2. Once the query is run, you will see an “Export” button at the bottom of the page under Query results operations – click that button (please note that there’s another “Export” button just below the query results which shouldn’t be used because it doesn’t export the results of the current query).

    3. You will now see a page titled “Exporting rows from “jos_users” table”. Choose “Custom – display all possible options”, and then scroll down and choose “View output as text”, and then uncheck “CREATE TABLE options” and finally click on “Go” at the bottom of the page.

    4. You now have a query that inserts all the users but it’s still pointing to the old jos_ table. Copy and paste that query in a text editor and replace jos_ with the table alias of your new Joomla website. You need to do a replace all as there might be several instances of jos_ in that query.

    5. You are now ready to import the users!

  2. Import the users into your new Joomla table

    Now that you have prepared the data in the steps above, all you need to do to import the data is the following:

    1. Paste the query generated above in the SQL tab in phpMyAdmin and run it. This query will import the users, but we will need to add those users to a group – usually group 2. (If you care about which group each user belonged to then contact us and we’ll help you do it as we have not covered this scenario here).
    2. To add all the exported users to group “2”, follow the below steps:

      1. Run the following query in the SQL tab:

        Select `id`, 2 FROM `jos_users` WHERE 1

      2. Export the results of that query using the method described above for exporting users. (e.g. press on the “Export” button below and then choose “Custom”, click on “View Output as Text”, uncheck “CREATE TABLE”, and click on “Go”)

      3. Copy the generated query from the above step into a text editor and change the following line:

        INSERT INTO `jos_users` (`id`, `2`) VALUES

        to this one:

        INSERT INTO `[table_prefix]_user_usergroup_map` (`user_id`, `group_id`) VALUES

        [table_prefix] should be replaced with the prefix of your tables for the new Joomla website.

      4. Now copy the modified query to the SQL tab in phpMyAdmin and run it.

      5. You have finished the user migration! (Congratulations!)

Clearly the advanced way may take some more time especially if your technical experience is not that strong – but if you do have a solid technical experience, then it should only take a little of your time!

Some caveats:

  • User migration using the userport extension will not keep the original ids of the users – which means that all the content (such as articles) associated with one user might be associated with another after the user migration (in the new website).
  • User migration using the phpMyAdmin method will maintain id association with the exception of the id of the super administrator.

  • Since ids are unique make sure you filter the query to insert users for any ids that already exist in the new table prior to running it – otherwise the query will crash during execution – and not all users will be imported.

Migrating users from Joomla 1.5 to Joomla 2.5 is easier than you might think – but we do understand if you don’t want to indulge yourself in the land of not-so-solid extensions and phpMyAdmin, and that’s why we’re here to help! All you need to do is to contact us and we’ll promise you that we’ll get your users exported and imported in no time and with little cost! We’re very reliable, we love our clients, and our clients love us!

16 Responses to “How to Migrate Users from Joomla 1.5 to Joomla 2.5”
  1. Comment by Chema — January 2, 2013 @ 11:16 pm

    Very useful, thanks!

    Btw, I also added the following parameters (i think these are important): activation, registerDate, lastvisitDate.

    I have also removed the field ‘param’ because some parameter from 1.5 was causing a malfunction in Joomla 2.5.

  2. Comment by Joanne — January 12, 2013 @ 5:19 pm

    Thank you for posting this, however, when running the query that installs the 1.5 users in phpmyadmin i receive an error that states mydatabaseprefix_users already exists? which it does in the 2.5 install. what should I do? Thanks

  3. Comment by Fadi — January 13, 2013 @ 2:34 am

    Hi Joanne,

    It seems that you have just exported the table instead of using the “Select” query to export the users. Try using the “Select” query as described above and then try importing the results. (The reason why you’re getting this error message is because a normal export of the table will also export the table structure).

  4. Pingback by How to Migrate Modules’ Data from Joomla 1.5 to Joomla 2.5 | itoctopus — March 2, 2013 @ 9:17 pm

    […] Note 4: This post is somehow similar to our previous post on migrating users’ from Joomla 1.5 to Joomla 2.5 – except that the latter is about migrating […]

  5. Comment by Ben — June 21, 2013 @ 3:55 am

    With many users you might find that one of the imported users has the same id as the SuperUser for Joomla 2.5. The id numbers in the Joomla 1.5 database start at 62 so you can edit the exported file to change that clashing user’s id to 61 before you import.

  6. Comment by Fadi — June 21, 2013 @ 11:48 am

    Hi Ben,

    Good idea. Quick note though: you must ensure that the number you choose (61) does not exist in the list of imported users.

  7. Comment by Joy — September 2, 2013 @ 11:09 pm

    Hi,

    Thanks for this advice it works. However, It only imports the first 30 rows (30 users)to the new database. I have 256 excluding user 62 of course. How do I get this method to import all 256 users?

    Please advise.

  8. Comment by Fadi — September 2, 2013 @ 11:12 pm

    Hi Joy,

    Please remove LIMIT 0, 30 from your first query and ensure that you are clicking on the “Export” link which is at the very bottom of the page.

  9. Comment by Joy — September 3, 2013 @ 7:47 am

    Hi Fadi,
    Thanks for your reply.
    I restarted the process, but now I get this error message: #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 256.

    Whats the SQL syntax mean?

    Thanks

  10. Comment by Joy — September 3, 2013 @ 7:59 am

    Hi Fadi,

    It worked! Don’t know what I did wrong 1st time but I did it again and it worked…

    Thank you.

  11. Comment by Jeff W — March 11, 2014 @ 7:44 pm

    I’m trying to copy all my users from Joomla 1.5 to 3.2:

    I got the first part but I must be missing something with the version of phpMyAdmin (2.6.4) or MySQL because I don’t see the screens you are referring to.

    From a conceptual point of view(correct me):

    1) Extract the entries from the user table into another table
    2) Copy the new table to the 3.2 database
    3) Insert the records from the new table to the user table of the 3.2 database

  12. Comment by Fadi — March 11, 2014 @ 7:50 pm

    Hi Jeff,

    Your process is correct.

    You also have to add the IDs of the users to the mapping table. Have you done that?

  13. Comment by Victor — April 9, 2014 @ 2:51 pm

    Hi Fadi,
    Thank you, for your advice !
    Unfortunately when I try to inject the users into the new DB (Joomla 3.1) I get the following massage: “#1050 – Table ‘jm3_users’ already exists “. Any ideas how can I fix it ?

    Thanks !

  14. Comment by Fadi — April 22, 2014 @ 1:54 am

    Hi Victor,

    Make sure you uncheck the “CREATE TABLE” option when exporting the jos_users table in Joomla 1.5.

  15. Comment by Lionel — November 6, 2014 @ 12:56 pm

    Hi and thank you for the post.

    Any idea on how to run the import if my query (exported after 23 minutes from phpMyAdmin) is +60Mb and crashes the phpMyAdmin when I try to import on Joomla 3.x .

    Thanks again,

    Lionel

  16. Comment by Fadi — November 15, 2014 @ 11:31 am

    If the size of the exported file is larger than your maximum allowed in phpMyAdmin, then what you need to do is to split the file into multiple files (ensuring that you don’t have any broken queries because of the split), and this should fix the problem.

Leave a comment