View Single Post
  #109  
Old 04-03-2009, 04:23 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Here's how I converted my accounts;
First you need something like Navicat so you can make a custom sql of the database's account table.
With Navicat, go to your account table, select id, name and password only, dump them into an sql.
You should see entries that look like this;
Code:
INSERT INTO account
   (`id`, `name`, `password`)
VALUES
   (31, 'myname', 'mypassword');
So you have to convert the password to encrypted and change table to point to login_accounts . Here's the script for that;

convert_account.pl
Code:
   #!/usr/bin/perl
    open(MYFILE,"./account.sql") || die "Couldn't open the file!\n";
    @Lines=<MYFILE>;
    close MYFILE;
    for(@Lines){
    s/account/login_accounts/;
    s/', '/', md5('/;
    s/'\);/'));/;
    #s/\(oldtext\)/\(newtext\)/;
    print $_;
    }
Run perl convert_account.pl > login_accounts.sql

Now, open login_accounts.sql, and it should look like this;
Code:
INSERT INTO login_accounts
   (`id`, `name`, `password`)
VALUES
   (31, 'myname',  md5('mypassword'));
Run this on a clean login_accounts and you'll be gtg.
This is for Minilogin users that already have Minilogin passwords in their table.
In my case I have 132 accounts (it grew some) this converted them in a flash.

Quote:
Originally Posted by Aldest View Post
Ignore the above post.

We're good to go now. I just have to figure out how to have my new schema reference my old one so that characters show up on the appropriate accounts.

Last edited by Angelox; 04-04-2009 at 12:26 AM..
Reply With Quote