jana
asked on
Proper steps to upgrade previous mssql db to an updated newest version of mssql
We just finished installing mssql2013 and have databases from sql2005 and the majority sql2008/sql2008r. To update these databases to sql2013, just attached them to the instance? What other steps to follow for proper "attach" and upgrading these databases?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
After you back up your dataBase, will be created file with extension *.bak. And then you select this file, when you will restode your database in SQL Server latest version.
... if I correct understand you.
... if I correct understand you.
it is the "main idea" - -to do prep work starting with running Upgrade Advisor and test on non prod server
DBCC UPDATEUSAGE(0)
DBCC CHECKDB WITH DATA_PURITY
DBCC DBREINDEX (see BOL , try DB main plan..)
or this code
DBCC UPDATEUSAGE(0)
DBCC CHECKDB WITH DATA_PURITY
DBCC DBREINDEX (see BOL , try DB main plan..)
or this code
DECLARE @TableName VARCHAR(255)
DECLARE @sql NVARCHAR(500)
DECLARE @fillfactor INT
SET @fillfactor = 80
DECLARE TableCursor CURSOR FOR
SELECT OBJECT_SCHEMA_NAME([object_id])+'.'+name AS TableName
FROM sys.tables
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @TableName
WHILE @@FETCH_STATUS = 0
BEGIN
SET @sql = 'ALTER INDEX ALL ON ' + @TableName + ' REBUILD WITH (FILLFACTOR = ' + CONVERT(VARCHAR(3),@fillfactor) + ')'
EXEC (@sql)
FETCH NEXT FROM TableCursor INTO @TableName
END
CLOSE TableCursor
DEALLOCATE TableCursor
GO
ASKER
Misha,
Eugene,
I see you don't recommend just a copy over then an "attach", rather backup in the source sql instances and restore "*.bak" in the sql2013.
Doing a restore, do I still have to run Eugene recommendations on of DBCC UPDATEUSAGE, DBCC CHECKDB, DBCC DBREINDEX?
Doing a restore, do I still have to run Eugene recommendations on of DBCC UPDATEUSAGE, DBCC CHECKDB, DBCC DBREINDEX?
Eugene,
Do I copy over the databases and "attach", then run you recommendations or do a backup "*.bak" from the source sql and restore in sql2013 then run your recommendations?
there is not MS SQl 2013 version
2012 2014 2016
it is important to know for sure
--
and 'yes' - -you must run all DBCC after restore
I'd dod backup and restore to new sql server
to have a good backup plan in case you need to roll back
2012 2014 2016
it is important to know for sure
--
and 'yes' - -you must run all DBCC after restore
I'd dod backup and restore to new sql server
to have a good backup plan in case you need to roll back
ASKER
OMG!!! Sorry about that!! I meant sql2012 (v11.0.7001.0 SP4 to be exact)
There is no need of roll back for us. The old sql instances are in use and are separate of sql2012 entirely and sql2012 is not in production (it's a test environment to assure all go well).
Ok, so attach is out of the question.
There is no need of roll back for us. The old sql instances are in use and are separate of sql2012 entirely and sql2012 is not in production (it's a test environment to assure all go well).
Ok, so attach is out of the question.
- That means in order to "restore" we have to create all the database first in the sql2012 instance right? (they dont' exist there yet)
- And finally, with the restore, you still recommend DBCC UPDATEUSAGE, DBCC CHECKDB, DBCC DBREINDEX afterward?
You create new database in MS SQL Server2012 and restore from back up file.
ASKER
Ok... (doing that right now... it's lots of databases)
What about my question, after doing the restore, do I still have to run DBCC UPDATEUSAGE, DBCC CHECKDB, DBCC DBREINDEX ?
What about my question, after doing the restore, do I still have to run DBCC UPDATEUSAGE, DBCC CHECKDB, DBCC DBREINDEX ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nice info! Just finished reading all three!
Ok, based on the docs, the best option and less time is Backup & Restore.
So, questions I keep asking and nobody answers:
Ok, based on the docs, the best option and less time is Backup & Restore.
So, questions I keep asking and nobody answers:
- To "Restore" we have to create all the database first in the sql2012 instance since it don;t exist there yet? Or is there a way that the "Restore" will create the database name?
- After "Restore", based on EE recommendations in the begghing, do hace to DBCC UPDATEUSAGE, DBCC CHECKDB, DBCC DBREINDEX afterward?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You are correct, the first question on creating the database prior restore was answer by Misha and your entry now clearly answers the second. Great info!
Thanx!
Thanx!
have fun :)
ASKER
Hahaha! Nice! Will do!
Will proceed to close the question.
Will proceed to close the question.
ASKER
Reviewing the question, found "if you use Full-text search - -it is an extra steps" - what addition steps? please provide link, we'll follow up on it.
ASKER
Hey Eugene, just saw that you also answer the questions previous in D: 42560121 (didn't noticed it)
make sure to install FTS component (part of sql install)
FTS will be in .ndf file (part of DB)
Upgrade Full-Text Search (same idea)
https://docs.microsoft.com/en-us/sql/relational-databases/search/upgrade-full-text-search?view=sql-server-2017
FTS will be in .ndf file (part of DB)
Upgrade Full-Text Search (same idea)
https://docs.microsoft.com/en-us/sql/relational-databases/search/upgrade-full-text-search?view=sql-server-2017
ASKER
Thanx!
ASKER
The above said,
Misha,
Eugene,
If "attach" can be done, you said "several important processes updateusuage; CheckDB with data_purity, reindex, update stats."; can you provide the apps or command that is needed?
Thank you both.
Please Note:
for us the databases sql2008/2008r are more important. If the databases of sql2005 are too complicated to bring over to sql2013, we can do without these sql2005 DB.