copying databases

Networking/Security Forums -> Databases

Author: wickerandvineLocation: alang-alang Mandaue PostPosted: Wed Aug 22, 2007 4:30 pm    Post subject: copying databases
    ----
I had a computer with MS SQL on it. It has a database on it too with it's data intact.. What I want to do is transfer the database to another computer with MS SQL. The first i tried is made a backup of data database, copy the backup and paste the database to the other computer. When I tried to restore it, it doesn't recognize the database. How can I successfully transfer a database from computer A to computer B so that MS SQL in Computer B will recognize the database?. Computer B is not on the netwowrk and both uses MS SQL.

Author: GroovicusLocation: Centerville, South Dakota PostPosted: Wed Aug 22, 2007 5:34 pm    Post subject:
    ----
From the command line (not mysql command line), mysqldump my_database > database.sql.

All of your data will be in a .sql script. Copy it over to the other computer. Open mysql, and type in source /path_to/database.sql.

http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html

Author: wickerandvineLocation: alang-alang Mandaue PostPosted: Thu Aug 23, 2007 3:03 pm    Post subject:
    ----
I have Microsoft Sql(MS SQL) not mysql.

Author: GroovicusLocation: Centerville, South Dakota PostPosted: Thu Aug 23, 2007 6:09 pm    Post subject:
    ----
Embarassed

My bad... what did you use to make the backup copy?

Author: wickerandvineLocation: alang-alang Mandaue PostPosted: Tue Aug 28, 2007 1:07 pm    Post subject:
    ----
let me restate it again. I have two computers A and B, both have MS SQL 7.0. I have a database in computer A that I want to transfer at computer B. Both computers are not in a network. I tried to back up the database from computeA and copied it to computerB and then tried to restore it but it doesn't work. Is there a better way for me to copy the database to computer B succesfully??

Author: carlokie PostPosted: Wed Sep 05, 2007 2:19 pm    Post subject:
    ----
Backup - restore is the best way go with this. When you try and restore from the file that you copied you say it does not recognize the database??
The only thing that I can think is that the restore is trying to create the data and log files for the database to the same physical file location as they are on machine A. there should be options in the restore to specify the file names?
If this does not help can you paste the error that you are getting.

Author: Colonel_Panic PostPosted: Sat Sep 15, 2007 4:07 am    Post subject:
    ----
I'm not exactly an MSSQL expert, but to my best knowledge, the easiest way to move MSSQL databases is detach-attach.
After you detach a database (there should be command for that in administration tools), you can handle it exactly as any os file, for example you can use Explorer to move it around. Once you've copied this file to some place where the other DB server can see it, you can use [attach] command to start using it as a database. And of course, attach it back to the original server as well if you still need it there.

I don't use MSSQL much, but I know that this is the preferred method for moving entire ERP databases in Windows environment. (so it should work with pretty much any database)
Sorry but I've got no idea on which MSSQL version you need for this.

Author: AdamVLocation: Leeds, UK PostPosted: Sat Sep 15, 2007 9:46 am    Post subject:
    ----
You will also want to make sure all transactions are committed and logs truncated.

You could always do this by doing a dump (SQL backup) of the data and then using this backup file to import from, rather than backing up the file as an OS object.

detach/attach might also work, I hadn't come across that method myself 'cos I'm not really a major SQL guy - I just know enough to find my way around when using something with SQL behind it like a DMS or case/practicemanagement system.

Code:
select skills from experience
    where had_to_do_this_once = "Yes"



Networking/Security Forums -> Databases


output generated using printer-friendly topic mod, All times are GMT + 2 Hours

Page 1 of 1

Powered by phpBB 2.0.x © 2001 phpBB Group