Home » Forums » DBManager General
 
Copy Data From One MSQL Database To Another (1982 previews)
Copy Data From One MSQL Database To Another Posted in 09th, 01/2005 03:52 by sirrhino
I would like to copy the data from one BBS database to a later version of the BBS database.

I currently am supporting a phpBB ver. 2.0.6 database and would like to upfrade to version 2.0.11 of phpBB. For complicated reasons, the easiest way to do this is to copy the data from the 2.0.6 tables into the 2.0.11 tables.

The two sets of tables have the same name but some of the 2.0.11 tables have extra fields. I've looked at the dbManager help files and played a little with it but am still confused.

Should I drag & drop the 2.0.6 tables into the 2.0.11 database? I am nervous about overrighting the tables with the extra fields.

Barring that, is there a way I can send commands like

INSERT INTO ver_2_11.Users SELECT * FROM ver_2_6.Users

diirectly to the MySQL database engine?

Thanks in advance for any help you can give me.



Sir Rhino /
Re: Copy Data From One MSQL Database To Another Posted in 10th, 01/2005 09:50 by support
Hi,

sirrhino wrote:
Should I drag & drop the 2.0.6 tables into the 2.0.11 database? I am nervous about overrighting the tables with the extra fields.

I believe that it will work ok if you dump and load the tables. DBManager usually adds complete INSERT's which means it doesn't matter the number of fields (unless they are in PKEY or set to NOT NULL)


sirrhino wrote:
Barring that, is there a way I can send commands like

INSERT INTO ver_2_11.Users SELECT * FROM ver_2_6.Users

diirectly to the MySQL database engine?


If the databases are in the same server that would be the way to go. You can sepecify the columns for the SELECT and for the INSERT INTO, both or none. Also if the new fields are set to not null or are part of the primary key you can fix them at this point.

Best Regards,


Support / DBTools Software
Re: Copy Data From One MSQL Database To Another Posted in 11th, 01/2005 12:46 by sirrhino
Ok, I got the console working, however ...

I have 2 Servers in my Workspace, phpbb_2_0_11 and phpbb_2_0_6. If I connect to only one of them, and do a SHOW DATABASES from the console, I see the one Server I have connected. If I connect both Servers and do a SHOW DATABASES, I only see one database listed (the first one - phpbb_2_0_11). Is this the way it's supposed to behave?

To the best of my knowledge both MySQL databases are on the same physical server.


Sir Rhino
Re: Copy Data From One MSQL Database To Another Posted in 11th, 01/2005 04:10 by support
Hi,

If you have both servers in your workspace it means you have two distinct connections and they are treated and different servers. If the dbs are in the same server you can just leave the database field in the Server Manager blank. With this the DBManager will show all databases in it.

PS: For your previous question it doesn't matter if the databases are in the same server or not. Dragging and Dropping the tables will provide the same results.

Best Regards,


Support / DBTools Software
Re: Copy Data From One MSQL Database To Another Posted in 12th, 01/2005 08:59 by sirrhino
Well, I'm making progress, thank you.

The two databases are on the same physical server with different usernames and passwords. Fortunately I was able to add the user from one database to the other, so I have a single user with access to both databases.

Went to the dbManager connection and deleted the name of the database, and then connected the dbManager server.

It worked ... not only could I see both databases in the Workspace, when I did a SHOW DATABASES; from the Console, I saw both databases.

I then looked at one of the smaller tables, phpbb_categories

SELECT * FROM phpbb_ver_2_0_11.phpbb_categories;
and
SELECT * FROM phpbb_ver_2_0_6.phpbb_categories;

Worked perfectly.

I then tried the obvious next step

INSERT INTO phpbb_ver_2_0_11.phpbb_categories SELECT * FROM phpbb_ver_2_0_6.phpbb_categories;

and got the following error message:

Error 0xC00CE509 on line 1, position 53
Reason: Required White Space was missing
Error Parsing XML Document

I am using MyWeb.php.


Sir Rhino
Re: Copy Data From One MSQL Database To Another Posted in 13th, 01/2005 03:31 by sirrhino
The reason I mentioned using MyWeb.php is because I got a similar error message one time when I forgot to put a copy of MyWeb.php on the server where dnManager could get to it.

Could it possibly be that MyWeb.php does not currently support

INSERT INTO ... SELECT ...

?
Sir Rhino
Re: Copy Data From One MSQL Database To Another Posted in 13th, 01/2005 05:28 by support
Hi,

If the databases are located in the same server this shouldn't be a problem. But you might have to use the database name when referencing the tables.
When running this query in the Query Builder you may use this command:


INSERT INTO db1.table1 SELECT * FROM db2.table2


If you don't do that the mysql will assume both table are in the same database which is not correct.
Usually, this operation is quite faster but of course, it depends on how many records there is in the table.
If you want send me both database structures. With that in hands I can study the best way to move data from place to another.

Hope that helps,

Support / DBTools Software
Re: Copy Data From One MSQL Database To Another Posted in 13th, 01/2005 06:26 by sirrhino
support wrote:
Hi,

If the databases are located in the same server this shouldn't be a problem. But you might have to use the database name when referencing the tables.
When running this query in the Query Builder you may use this command:


INSERT INTO db1.table1 SELECT * FROM db2.table2


If you don't do that the mysql will assume both table are in the same database which is not correct.
Usually, this operation is quite faster but of course, it depends on how many records there is in the table.
If you want send me both database structures. With that in hands I can study the best way to move data from place to another.

Hope that helps,

Support / DBTools Software


**********

INSERT INTO db1.table1 SELECT * FROM db2.table2

basically I did that

INSERT INTO phpbb_ver_2_0_11.phpbb_categories SELECT * FROM phpbb_ver_2_0_6.phpbb_categories;

db1 = phpbb_ver_2_0_11
db2 = phpbb_ver_2_0_6
table1 = phpbb_categories
table2 = phpbb_categories


If you want send me both database structures. With that in hands I can study the best way to move data from place to another.

Thank you very much, do I send them to suporte@dbtools.com.br?
Sir Rhino
RE: Copy Data From One MSQL Database To Another Posted in 25th, 03/2015 04:40 by linmikey
You get the sense that Pele knows iphone 6 plus protective film what you are going to ask him even before you start to formulate the words. Double Sided Adhesive Perhaps it is just natural intuition, the same instinctive understanding for human behaviour—and how he can use that to his own advantage—that die cut helped make him the greatest footballer, and the most prolific goalscorer, Stand Up Pouches the sport has ever seen.

zenok5528 /

Copy Data From One MSQL Database To Another (1982 previews)
Legends

Topic has Replies
Topic With no Replies
 
Home » Forums » DBManager General