migrating ms sql database to new server - sql-server

Scenario:
We have MS SQL 2005 installed on a windows 2003 server with 9GB database.
We acquired a new Windows 2012 server and installed MS SQL 2014 on it.
My expertise level:
Partial knowledge of SQL server and databases
What I need:
I am given a task to migrate the 9GB database (SQL 2005) to a SQL 2014..
DB names and all should be identical to old one..
I would like to know the steps involved from experts, so I can achieve this job w/o any issues.
I am thinking of below steps:
1) Full Backup of 2005 database...
2) Create a new database with same name on the new server
3) Restore the full backup (taken on old server) on the new server
4) Change the compatibility level to suit to the new sql server
pls. let me know if this works or do I need to follow other approach.
any queries, pls. feel free to ask.
sql_learner

You can use Copy Database Wizard,The Copy Database Wizard lets you move or copy databases and their objects easily from one server to another.
Check this

I tried below steps and it worked w/o any issues...
1) Full Backup of 2005 database... 2) Copied backup data on to the new server 3) Restored the full backup (taken on old server) on the new server 4) Change the compatibility level to suit to the new sql server (120).
The above steps worked for AdventureWorks sample database for me...
Before I go ahead with the original DB, I need to know if what I did is correct or am I missing something.
Raj

upon further search on this forum, i found below link with a scenario similar to mine and seems what i did is the correct way...
just in case someone lands here, they can quickly check this link...
SQL Server 2005 migration to new environment SQL Server 2012

Do you have any database users setup that you will also need to transfer? If so, you will need to reset these up at the instance level SSMS > Security.
Also don't forget to transfer any maintenance plans or jobs from the old to the new server (such as backup / defrag / DBCC checks).

Related

How can migrate all databases from one server to another server in SQL Server

I want to migrate my all databases from SQL Server 2012 to SQL Server 2014. Is there any way to do all in one short instead of one by one?
you can simply do in-place upgrade in the same server, instead of migration, if possible. It will one-shot operation.
You can do side by side migration, by taking backup in source environment(MSSQL 2012) and restore databases in target environment(MSSQL 2014).
This is a very important operation and many things have to be planned. You have to have migration plan for this.
You can use upgrade advisor tool for this. It will tell you whether everything is fine on your instance for initial analysis: https://msdn.microsoft.com/en-us/library/dn236457(v=sql.120).aspx
Also, read below articles.
https://thomaslarock.com/2014/06/upgrading-to-sql-server-2014-a-dozen-things-to-check/
https://blogs.technet.microsoft.com/meamcs/2013/12/14/what-to-consider-when-creating-sql-server-database-migration-plan/
There are lots of guides available online. Just search internet. you will find many guides.
You can do it in 2 ways:
1.Create a backup of your database and restore it in new server.From Management Studio you can Right-click on your database then select Tasks -> Back up.
2.Generate script, create the database in the new server and run the script.From Management Studio you can Right-click on your database then select Tasks -> Generate Scripts.

restore a sqlserver 2005 database into sqlserver 2012

I have a db running on an instance of sqlserver 2003, Ive tried to import it into sqlserver 2012 but that wont work it's says it's to old.
so I've imported it into sqlserver 2005, I have then backed it up again and tried to import it into sqlserver 2012 but it comes up with the same error.
I can restore other db's from sqlserver 2005 so I can only presume its keeping its 2003 settings when I back it up.
Can anyone help
I suspect that your database might have some deprecated functionality that prevents your upgrade from working.
There's a list of deprecated functionality between SQL Server 2000 and SQL Server 2005 on technet.
I would strongly advise you to use the SQL Server 2005 Upgrade Advisor to identify such functionality, and address any potential issues. Then, and only then you should have a database compatible with SQL Server 2005, and can (hopefully) proceed from there.
if u want database structure only then take database script then run into sql server 2005, if u want database with data also mean
right click the Database go task
click Generate Script
There Two options entire database or with specific objects
entire database for DataBase structure only
with specific objects - select all objects then click Next you find the Advance button then click it.
scroll down and Find Type of Data Scripts click and change to Schema and data then you will save as file file or new query window
this is one of the method to restore the database.
Set your compatibility level to (90) Sql server 2005 in your database properties after restoring.

Log shipping using SQL Server 2000 Standard edition

I have one production database on SQL Server 2000 Standard Edition and would like to upgrade it to SQL Server 2005 Standard edition. How to accomplish this task in case of copying transaction log file from source and restore to destination database and making the destination database online also how can I create database user while the destination database is on NORECOVERY mode?
Any help would be appreciated.
Thanks experts
Apologize for my incomplete question and lack of SQL knowledge
I already backed up and restore the production DB on target server with NORECOVERY mode while the production server operational (still operational) what I want to do is (if applicable) prepare the target server before I cutover. Now I'm migrating DB objects to target server and once all objects are migrated to target server I'll take the database online by restoring the last log backup if log shipping is applicable in SQL2k standard edition.(my upgrade path is side-by-side)
Thanks all in advance
I'm not sure what part log shipping plays in your upgrade.
The steps you should take are:
Install SQL 2005 on a new server.
Take your production system offline.
Perform a backup.
Restore the backup to the new server.
Attach your production system to the new server.
Test..test..test.
After you've moved it over, you might consider changing the compatibility level of the database in the new server to SQL 2005. However, be aware that there are many differences between SQL 2000 and 2005. So review this: http://technet.microsoft.com/en-us/library/ms143232(v=sql.90).aspx to get an idea of what issues you might have.

How to restore SQL Server 2014 backup in SQL Server 2008

Were there any changes in this area with SQL Server 2014? I’ve seen this post Is it possible to restore Sql Server 2008 backup in sql server 2005 and I know that this was not possible as a scenario for 2012 -> 2008 but I wonder if MS made any changes here with the 2014 version.
We are evaluating 2014 version and we have a fairly large database in testing. We’d like to restore a backup of that database to SQL Server 2008 because that physical machine has more space, RAM,…
I’m getting standard error message when I try to restore backup but I was wondering if there is something else in SQL Server 2014 that I might be missing.
No, it is not possible. Stack Overflow wants me to answer with a longer answer, so I will say no again.
Documentation: https://learn.microsoft.com/en-us/sql/t-sql/statements/backup-transact-sql#compatibility
Backups that are created by more recent version of SQL Server cannot
be restored in earlier versions of SQL Server.
Not really as far as I know but here are couple things you can try.
Third party tools: Create empty database on 2008 instance and use third party tools such as ApexSQL Diff and Data Diff to synchronize schema and tables.
Just use these (or any other on the market such as Red Gate, Idera, Dev Art, there are many similar) in trial mode to get the job done.
Generate scripts: Go to Tasks -> Generate Scripts, select option to script the data too and execute it on 2008 instance. Works just fine but note that script order is something you must be careful about. By default scripts are not ordered to take dependencies into account.
It is a pretty old post, but I just had to do it today. I just right-clicked database from SQL2014 and selected Export Data option and that helped me to move data to SQL2012.
Pretty old question... but I had the same problem today and solved with script, a little bit slow and complex but worked. I did this:
Let's start from the source DB (SQL 2014) right click on the database you would like to backup -> Generate Scripts -> "Script entire database and all database objet" (or u can select only some table if u want) -> the most important step is in the "Set Scripting Options" tab, here you have to click on "Advanced" and look for the option "Script for Server version" and in my case I could select everything from SQL 2005, also pay attention to the option "Types of data to script" I advice "Schema and data" and also Script Triggers and Script Full-text Indexes (if you need, it's false by default) and finally click ok and next. Should look like this:
Now transfer your generated script into your SQL 2008, open it and last Important Step:
You must change mdf and ldf location!!
That's all folks, happy F5!! :D
No I guess you cannot restore the databases from higher version to lower version , you can make data flow b/w them i,e you can scriptout.
http://www.mssqltips.com/sqlservertip/2810/how-to-migrate-a-sql-server-database-to-a-lower-version/
Please use SQL Server Data Tools from SQL Server Integration Services (Transfer Database Task) as here: https://stackoverflow.com/a/27777823/2127493
If you have both versions you can create a merge replication from new to old. Create a merge publication on your newer sql server and a subscription on the older version. After initializing the subscription you can create a backup of the database with the same structure and the same content but in an older version and restore it on your old target server.
You can use this method also with sql server 2016 to target 2014, 2012 or 2008.

Can an MS SQL 2005 backup be restored onto an instance of MS SQL 2008?

Is it possible to restore a backup of a SQL Server 2005 database onto an instance of SQL Server 2008?
I need to rebuild a server as it's getting rather crufty, so I plan to take this opportunity to upgrade to SQL 2008 and wondered if I'll be able to restore my backups OK.
Upgrading from 2005 to 2008 is OK, moving back might require more work
N.B. You might have a problem with your database the logins (as they will not exist in the new server master db) but that's something which would happen regardless of the server version. Just re-create them and re-associate with your database.
Yes, but make sure that ALL of your servers are SQL 2008. If you have development, test, QA or disaster recovery servers, all of them will need to be 2008, since 2005 servers won't be able to restore a 2008 backup.
To prevent the lost-login problem that Ilya mentioned, follow the steps in this knowledge base article. SP_Help_Revlogin will script out your logins, and you can apply that script on the new server. Presto, all your logins are back with the same SIDs and everything.
http://support.microsoft.com/kb/246133
(And just for future reference, this is how we upgraded StackOverflow last night, heh.)
http://twitter.com/SuperDalgas/status/976719756
You can restore the 2005 backup with 2008 without any problems. The compatibility from this point of view is nice.
Backward is not possible only with backup files.
In any case you can also recreate the database structure and use SSIS to transfer data from one server to another.
You can also do a detach/attach with the database files (leastways you could going from 2000 to 2005), but there are more caveats with this approach (requires explicit rebuild indexes afterwards IRRC)

Resources