Copy USERS and TORRENTS from torrent-trader to Project U-232 V2?

Started by Loffen, June 09, 2011, 09:20:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cherwonk

I use this to go from an older TBDev to the 09 Source
REPLACE INTO users (
id, username, passhash, secret, passkey, email, status, added, last_login, last_access, curr_ann_last_check , curr_ann_id , forum_access, editsecret, privacy , stylesheet, info,
acceptpms, ip, class, override_class, avatar, av_w, av_h, uploaded, downloaded, title, country, notifs, modcomment, enabled, avatars, donor, warned , torrentsperpage, topicsperpage,
postsperpage, deletepms, savepms , reputation, time_offset, dst_in_use , auto_correct_dst, show_shout, chatpost, shoutboxbg, smile_until, sig_w , sig_h, signatures, signature, anonymous,
invites , invitedby, invite_rights, invitees, seedbonus, bonuscomment, vip_added, vip_until, last_browse , passhint, hintanswer, uploadpos, forumpost, downloadpos, immunity, leechwarn,
        sendpmpos, highspeed, donoruntil, donated, total_donated, vipclass_before, freeslots, free_switch, forum_mod, forums_mod, mood, subscription_pm, hnrwarn, hit_and_run_total, support, supportfor, bjlosses , enshout)
SELECT
id, username, passhash, secret, passkey, email, status, added, last_login, last_access, curr_ann_last_check , curr_ann_id , forum_access, editsecret, privacy , stylesheet, info,
acceptpms, ip, class, override_class, avatar, av_w, av_h, uploaded, downloaded, title, country, notifs, modcomment, enabled, avatars, donor, warned , torrentsperpage, topicsperpage,
postsperpage, deletepms, savepms , reputation, time_offset, dst_in_use , auto_correct_dst, show_shout, chatpost, shoutboxbg, smile_until, sig_w , sig_h, signatures, signature, anonymous,
invites , invitedby, invite_rights, invitees, seedbonus, bonuscomment, vip_added, vip_until, last_browse , passhint, hintanswer, uploadpos, forumpost, downloadpos, immunity, leechwarn,
        sendpmpos, highspeed, donoruntil, donated, total_donated, vipclass_before, freeslots, free_switch, forum_mod, forums_mod, mood, subscription_pm, hnrwarn, hit_and_run_total, support, supportfor, bjlosses , enshout FROM users2


you would use a similar to do the torrents if the tables are different

daffy81

pretty simple but i dont know about that script, and if its possible but probably. basicaly ALL you do is export usesr table from TT database, name the file users2.sq and dump it in ftp root, place that script into root also. edit the users2.sql and change database name from users to users2 (rename) i.e part for  insert table into users  to users2 also all the sqls for insert into user for users will be users2.

hit the script in your browser and it should import users2 table into users table in new database :)

or something around them lines ( i know what i mean hahaha), im pretty stoned atm so i maybe just wobbling on hahaha (well thats my excuse) pmsl

Loffen

I have this, but i have noe idea how i do this  :-[

<?php
require_once("include/bittorrent.php");
dbconn();

# Table Names
$old_tableprefix "users2"// Old table name
$new_tableprefix "users"//New Table Name

$query mysql_query("SELECT id, username, password, secret, email, status, added, last_login, last_access, class, ip, avatar, uploaded, downloaded, title, enabled, invited_by, donated, invitees, warned FROM {$old_tableprefix}") or sqlerr(__FILE__,__LINE__);

stdhead();
begin_frame("Import Users");
echo 
"I will try to update user table --> ";
$count=0;
while (
$olduser mysql_fetch_assoc($query)){


$id sqlesc($olduser['id']);
$username sqlesc($olduser['username']);
$password sqlesc($olduser['password']);
$secret sqlesc($olduser['secret']);
$email sqlesc($olduser['email']);
$status sqlesc($olduser['status']);
$added sqlesc($olduser['added']);
$last_login sqlesc($olduser['last_login']);
$last_access sqlesc($olduser['last_access']);
$ip sqlesc($olduser['ip']);
$class sqlesc($olduser['class']-1);
$avatar sqlesc($olduser['avatar']);
$uploaded sqlesc($olduser['uploaded']);
$downloaded sqlesc($olduser['downloaded']);
$title sqlesc($olduser['title']);
$enabled sqlesc($olduser['enabled']);
$warned sqlesc($olduser['warned']);
$donated sqlesc($olduser['donated']);
$status sqlesc($olduser['status']);
$invited_by sqlesc($olduser['invited_by']);
$invitees sqlesc($olduser['invitees']);

$bohp yes


mysql_query
("INSERT INTO {$new_tableprefix} (id,username,passhash,secret,email,status,added,last_login,last_access,ip,ava
tar,uploaded,downloaded,title,enabled,warned,invitedby,invitees,class,donated,tot
al_donated,bohp)
VALUES (
$id$username$password$secret$email$status$added$last_login$last_access$ip$avatar$uploaded$downloaded$title$enabled$warned$invited_by$invitees$class$donated$donated$bohp)");
$count++;
}

echo 
"Done..<br><br>Total {$count} users has been updaded...<br>Note: All users may have to recover their password...";
end_frame();
stdfoot();
?>


$old_tableprefix = "users2"; // Old table name
$new_tableprefix = "users"; //New Table Name