SQL Server 2008 - moving data from SQL Server 2000 - sql-server-2008

Our company is getting ready to move next week and we currently use SQL Server 2000 for all our databases, hosted in our own building. They've decided to move the data to a local company for several reasons, but they are running SQL Server 2008.
I'd like advice on a few things:
We are trying to setup a test for just a few of our databases to see what breaks with our apps (connection strings, etc.). What is the best way to get a database from our SQL Server 2000 box to the new box without losing data or having to recreate the table, etc. I tried the DB Copy Wizard but restrictions within our network don't allow it. If I create a DB on SQL Server 2008 and perform a RESTORE from the SQL Server 2000 .bak file, I will lose all the transactions, correct? What if I replace the transaction files later? I'm thinking that won't work though.
How to properly upgrade a SQL Server 2000 database to SQL Server 2008? I've run the wizard against most of our databases and it came up clean with the exception of a few minor issues that I can resolve.
Our SQL Server 2000 is our production server so it can't go down at any point to copy files.... not until the move. Our customers have been notified that there will be a short outage period between certain dates so that's ok, but I guess what I'm saying is I can't stop the SQL Server Agent right now just to copy log files and such for testing purposes.
Any help/advice is greatly appreciated!

Create a database backup of the SQL Server 2000 and restore it to the SQL Server 2008.
Setup replication making the SQL Server 2000 as the Publisher and the SQL Server 2008 as the Subscriber.

Not sure which would be the best approach. I think a DB backup and restore would be a good idea. You will loose some data in the mean time, though.
If you were migrating between 2 versions of 2005 or 2008 I would advise a log backup to reduce the data lost but I don't think that this option is available on 2000
One piece of advice I can give you is to take a look at the discontinued features from 2000 and 2005 and from 2005 and 2008 on these links:
2005
2008

Just back up 2000, and then restore it. You won't lose transactions, no difefrent to doing a full backup on your current server.
You'll need to add any SQl logins and set the permissions etc.
You'll need to to do fix users for them as well.
If you only use integrated access then you don't need to.
e.g.
Use MyDataBase
EXEC sp_change_users_login Auto_Fix, 'MyUser'
And you'll need to set the compatibility level
Use
exec sp_bcp_dbcmptlevel 'model'
to get it
and then
EXEC sp_dbcmptlevel 'MyDatabase', ??
to set it.
Another option, would be to install 2000 on your new machine restore a back from the old one and then do an inplace upgrade through the 2008 installation wizard. That sort of thing tends to give my sphincters palpitations though.

Related

SQL Server sync to MySQL program

I want to continually sync every 30 mins or less around 380000 rows of data from 11 tables from a SQL Server database to a MySQL database. How can I do this? What programs can do this?
This post, which is often used to close questions like these as a duplicate, does not work for me, for the following reasons.
The SQL Server is part of a CRM system, I'm not sure if it may be a lite version or something, but long story short I do not have access to the SQL Server Management Studio.
The MySQL database is part of my hosting package, which means I have access to it via phpmyadmin and the like, but not to the console or anything. And obviously I cannot access it via localhost.
So basically what I'm looking for is a way to connect to both databases, probably via ODBC drivers, and sync data every x minutes/hours.
I finally used a program called Omega Sync. Now called Spectral Core Replicator.
Omega Sync can compare and synchronize both database schema and table data. Schema comparison and synchronization for databases of same kind
Data comparison and synchronization even for databases of different kind
Compare and Synchronize databases of unlimited size!
Supported databases
Access
SQL Server
MySQL
Oracle
Interbase
Firebird
ODBC sources
I am not associated with this company or product in any way.
Microsoft SQL Server replication can apply the changes to generic ODBC/OleDB subscribers. You can configure MySQL as a subscriber if you follow the right steps and use the correct drivers, but is not officially supported so you are on your own if something goes wrong. Eg. see Set up replication between Microsoft SQL Server 2000 and MySQL. since the article is for SQL 2000 is already deprecated since Microsoft SQL 2008 supports OleDB subscribers, not ODBC.
You will need a very deep understanding of both Microsoft SQL Server, MySQL, ODBC/OleDB and Microsoft SQL Server replication. If you hit errors you'll have to solve them on your own, as the public information on this subject is scarce. I can only tell you that is possible and I've seen it done. Good Luck!

Can we restore database backup of SQL Server 2008 R2 Express to SQL Server 2008 Express

I have a database backup in "SQL Server 2008 R2", Can i store this database backup in "SQL 2008 Express" ?
Anyone who have knowledge about SQL-2008 kindly share to me.
No and 'yes'.
A backup (.bak) is not possible, nor is copying .mdf over but you can downgrade.
You could go back to 2005 if you wish to.
I found this information which runs you through it the easy way.
How to Downgrade SQL Server Database
Direct link: http://www.mytechmantra.com/LearnSQLServer/Downgrade_SQL_Server_Database_P1.html
TIP: Use Microsoft OLEDB connector to destination instead of the native client and you should avoid any errors in the transfer
Nothing is impossible, you just have to get creative :)
Install an instance of SQL 2008 R2 on one machine and SQL 2008 on another
Open SQL Server Management Studio R2
Select your source Database
Select Tasks>Generate Scripts.
Select 'Script entire database and all database objects', press 'Next'
Select 'Save to File' and click on the 'Advanced' button
Select 'Script for Server Version' and select the version you want: 200/2005/2008
Select 'Type of data to Script' and select Schema/Data/both
Click 'OK',Next and do it!
Copy the resulting file to the target machine with SQL 2008 [or whatever]
Log onto your SQL Management Studio and open the copied .sql file... be aware that there may be limitations on the file size.
There may also be issues with the order that the .SQL file inserts the data into the target database and if there are FK constraints in place, this could be an issue.... simply re-order the insert lists.
Once the .sql file is organized, parse it [just to sure], and then execute.
Let me clarify a little on these directions.
On the SQL Management Tools be logged into both the old and the new server if possible.This makes these steps even easier.
So, start with the source server, right click on the database and script it. There is one option called ‘Script Data’ that is off by default, we set it to true so the script will include inserts for all of the data. We choose to script the tables, views, indexes and keys (and triggers … not sure if you use any of those). I also did not mess with the users, since that is problematic. It is easier to create the user by hand once on the local SQL server and give them permissions to the dbs.
Then script the DB to a file.
Then select the local SQL server and add the database by hand, then open up the script file and execute it under the new database, all the tables, data, indexes, etc came over just fine. Setup the user permission and you are golden.
NO, you cannot do this.
There is no way, no method, no hack, no workaround, no trick to get a backup from a more recent version of SQL Server back into an older version.
It just doesn't work - it's not supported.
You'll need to synchronize your structure using some kind of SQL diff tool, and possibly your data by exporting and importing, e.g. via the "Data Export / Import" wizard or some custom way.

Migrate from sql server 2000 to 2008 r2 - how to

I have a database working on SQL Server 2000. We are now migrating to a new server with SQL Server 2008 r2. Can anyone please point me to some resource or howto?
I'm not really finding my way around SQL 2000.
Thank you!
Basically, what you need to do is:
backup your database in SQL Server 2000 to a .bak file
move that *.bak file to your new server
restore that database onto your new server
You're done! There's really nothing more to it..... just backup (on your old system) and restore (on your new system).
So where exactly is your problem ??
Update: as #Péter correctly mentions: this leaves your database in the SQL Server 2000 compatibility mode. This means: even though you've "migrated" to SQL Server 2008 R2, you can still only use the 2000 features.
In order to see what compatibility mode your database is in, check the sys.databases catalog view:
SELECT * FROM sys.databases WHERE name = 'YourDatabaseName'
One column is called compatibility_level and contains an INT; 80 = SQL Server 2000, 90 = SQL Server 2005, 100 = SQL Server 2008 / 2008 R2 and 110 = SQL Server 2012
In order to change your database to a different compatibility level, use this command:
ALTER DATABASE YourDatabaseNameHere
SET COMPATIBILITY_LEVEL = 100;
This will put your database into the "native" SQL Server 2008 (and 2008 R2) mode and now your migration is complete, you can use all the new SQL Server 2008 R2 features.
I would start by running the Upgrade Advisor against the 2000 server (during low utilization or off hours) to see what recommendations it makes and fully address each: http://msdn.microsoft.com/en-us/library/ms144256.aspx
Here too is a white paper from MS on the topic: http://download.microsoft.com/download/2/0/B/20B90384-F3FE-4331-AA12-FD58E6AB66C2/SQL%20Server%202000%20to%202008%20Upgrade%20White%20Paper.docx
A lot could go wrong...too much to cover in a forum setting. But then again nothing could go wrong...the best plan, test, and then test some more.
The others answers are correct from a technical perspective but not from a support point of view.
I don't think Microsoft support a direct upgrade from SQL Server 2000 to SQL Server 2008 R2. That doesn't mean it is hard, just that it is not supported. (Which may or may not be significant for your scenario)
You can upgrade your SQL Server 2000 instance to SQL Server 2008 R1 and then perform a subsequent upgrade to SQL Server 2008 R2. (Or even SQL Server 2012 if you are so inclined)
I am currently doing the same thing.
Creating your SQL 2008 database from a 2000 restore bak is a good first step. Most of the work for me was dealing with the user permissions, and making sure that the users were in sync with the database login, and that we didn't have a database schema generated by the backup tied to that user that would cause problems if we tried to recreate that database user.
What we ended up doing was:
1) Create a script. We had a script that would dynamically write a script to do the following: drop login, drop db user, drop schema, recreate login, recreate user, grant user permissions.
2) Restore database.
4) Run the generated script
Edited Apr 2012 because original link changed to latest version, SQL Server 2012
For an "in-situ" upgrade (MSDN links):
... to SQL Server 2008 R2
You can upgrade instances of SQL Server 2000, SQL Server 2005 or SQL Server 2008 to SQL Server 2008 R2.
... to SQL Server 1012
You can upgrade from SQL Server 2005, SQL Server 2008, and SQL Server 2008 R2 to SQL Server 2012.
yet another option is to try to connect database (files) of sql2k to sql2k8 directly.
The simpliest way is to back up your database in SQL 2000 to a .bak file and move it. Do a restore and everything should be fine. Run a sp_Users_Loging to identify the users in the orphan server.

MySql emulation running on Microsoft SQL 2008

We have an application that cannot be altered. The only configuration changes permitted on the application are : host ip, username and password.
The application streams data into a MySql database. Another application then sends this data onto a Microsoft SQL 2008 server.
I would like to remove this middle step and wondered if anyone knew of a way that Microsoft SQL Server 2008 could be configured to 'pretend' to be a MySql database?
Your help is very much appreciated.
Why 'send' the data to the SQL Server when you can just create a linked server?
It cannot be done. MySql and MSSQL are 2 completely different products with different connectionprotocols, a different SQL dialect, different behaviour at times and so on.
I'm sorry.

SQL Server 2008 and MySQL Daily Backups

Is there a quick and easy way to backup both SQL Server 2008 and MySQL, all their databases?
Right now I have a batch script that runs, but I have to manually add a database each and every time, and I'm sick of maintaining it. So I want to set it up to backup all SQL Server and then all MySQL, I dont care if its two different solutions, just want the ability to backup all the databases without having to type them in.
Thank you.
2008 - sure. Set up a maintenance bach, tell it to back up all (all user) databases, finished. WIll run regularly and back up the database set asked for. MySQL - no idea.