PDA

View Full Version : Transferring just a few tables...


N9ne
10-25-2002, 07:14 PM
how can I transfer some tables from one DB to another DB? I want to get everything to do with the users/usernames etc. but no custom titles or avatars. I want to keep members, posts, threads, too. How can I just choose what I want to keep?

NTLDR
10-25-2002, 07:28 PM
Slelect the tables you wish to dowload in the Backup Option in the ACP.

N9ne
10-25-2002, 09:14 PM
I heard backing up from adminCP is useless, I have a big DB :( [and it's all the posts, threads etc. that take a lot of space up?]

I also forgot to mention I want to keep the attachments...[that's another whole load eh].

NTLDR
10-25-2002, 09:18 PM
Backing up from the CP is fine, I've never had any problems with it, its restoring via the web thats the problem, you need SSH access to restore a large DB.

N9ne
10-25-2002, 09:21 PM
So what you're saying is, I can download such and such from the adminCP, and restore it via SSH?

I have SSH access etc. so how do I restore certain tables like that?

NTLDR
10-25-2002, 09:27 PM
Just upload the MySQL files to you server and SSH in, cd into the directory they are stored and use the follwing command:

mysql -u USERNAME_HERE -p -h MYSERVERHERE.COM MYvBDB < FILE.sql

Making sure you replace the upper case sections with your username, MySQL server, the database the dump is going into and the name of the file on the server.

It will prompt for you password when you press enter.

N9ne
10-25-2002, 09:29 PM
MYSERVERHERE.com ... this the mySQL server? I have localhost as that? I'm a bit confused over that part ;)

Also, I thought I'd add that I have PhpMyAdmin, and that both databases are on the same host etc. in the same control panel! Is it possible to just transfer very quickly via phpmyadmin as they're on the same host and same hosting account?!

NTLDR
10-25-2002, 09:33 PM
Yes if there on the same host there is an option to. Click a table name in the right colum and then in the main fram scroll to the bottom, you will see:

Copy table to (database.table):

Select the DB you want to copy to and enter the table name, it should then copy it accross.

Thats where it is in v2.2.4, it may have moved in newer versions of phpMyAdmin.

N9ne
10-25-2002, 09:37 PM
It's still the same, when it copies, does it overwrite? [I want it to...I want it to completely change the one that's there with the one i'm transferring]...

NTLDR
10-25-2002, 09:55 PM
I would have thought that it would have overwritten it, but I've never used that function, you can allways drop the tables on the DB your copying them too just to be sure.

N9ne
10-26-2002, 09:46 AM
Ok and one more question lol...

When I transfer all the posts over, I understand the postids etc will be ok but what forums will all the threads etc be in!? I mean imagine, I transfer the posts but it doesn't say what forums they are in or does it? Maybe it has forumid?

Chris M
10-26-2002, 10:00 AM
I think the threads do have a forumid;)

Satan

N9ne
10-26-2002, 11:31 AM
So I would have to re-create the forums and go to phpmyadmin, look in the DB and manually change forumid numbers? Because this will pose as a problem whilst recreating forums, as it assigns forumids...

NTLDR
10-26-2002, 06:13 PM
You would need to run the following query for each forumid to update them, or alternativly copy the forum table to:

UPDATE thread SET forumid=C WHERE forumid=W;

Make C the new forumid and W the old forumid.