Import

Started by FTWR, October 01, 2011, 09:42:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zokii1983

Quote from: autotron on October 02, 2011, 04:00:45 AM
Guess every one has thier set ways of doing it :lol: I generaly print the structure of the new database and then goto the old and check all the tables that are the same click browse so only those tables display then export that output, then its a simple matter of importing it to new database.
The only real issue i have found was dates, most older databases are set day month year type format where this (v2) is timestamp so not compatable

you can use unix_timestamp
I saved my query when I was moving from tbsouce to u-232 v1
so here it is
insert into torrents_new (id, info_hash, name, filename, save_as, search_text, descr, ori_descr, category, size, added, type, numfiles, comments, views, hits, times_completed, leechers, seeders, last_action, visible, banned, owner, numratings, ratingsum, nfo, freeleech) select id, info_hash, name, filename, save_as, search_text, descr, ori_descr, category, size, unix_timestamp(added),  type, numfiles, comments, views, hits, times_completed, leechers, seeders, unix_timestamp(last_action), visible, banned, owner, numratings, ratingsum, nfo, free from torrents

autotron

Guess every one has thier set ways of doing it :lol: I generaly print the structure of the new database and then goto the old and check all the tables that are the same click browse so only those tables display then export that output, then its a simple matter of importing it to new database.
The only real issue i have found was dates, most older databases are set day month year type format where this (v2) is timestamp so not compatable

Bjw

I did it the same way or close.I exported the tables only first and then compared them to the new tables.I added any of the tables that were missing between the two to the new code then imported the users torrents etc then deleted the unused tables after the import was successful.I have done this with two sites with no problems.

cherwonk

What I had to do was make a new table users2 and import all the users to the db .
Then the tough part comes
Code (mysql) Select
REPLACE INTO users (field1, field2, field3, field4)
SELECT field1, field2, field3, field4 FROM users2


You'd need to do all the fields you want to transfer over to the new table. Of course there will some entries that arent in the new users ... those you wont need unless you install the mod for them.

FTWR

Hello guys!! I like so much this source code, so I decided to change my Tbdev 2009 with it, but...how I make the import at users and torrents, I don't want to lose them. So, can somebody help me?

//Sorry for my bad english., thanks!!