Move/copy SQL Server 2005 full text index - sql

We are moving our database server to a bigger box. I have several databases with full text indexes. What is the best way to move the full text indexes?

I find backup and restore is the only reliable way to move databases. The FTS should move with it when you do that. Detaching and reattaching databases never really sits well with me.

If you are moving the databases, move the folders that contain the FTS information and you should be fine.
If you're doing a restore, you should be fine as is.

My first attempt was to copy over the database files and reattach them. I ran into the following error when attempting to access the catalog:
Full-text catalog 'database name' is in an unstable state. Drop and re-create this full-text catalog. (Microsoft SQL Server, Error: 7624
My second and Successful attempt was to restore the database from backup as Craig suggested. My catalog did come over but I received the following error:
Property IsAccentSensitive is not available for FullTextCatalog '[CatalogName]'" This property may not exist for this object, or may not be retrievable due to insufficient access rights. (Microsoft.SqlServer.Smo)
After a quick google search I found the answer
MS KB 910067
Simply detach and reattach the database and I was fine.

Related

Backup failed for Server, The media is formatted to support 2 media families Error

Can any body tel me how to overcome this error when taking a backup in SQL Server 2008 Express?
Backup failed for Server '\SQLEXPRESS'. (Microsoft.SqlServer.SmoExtended)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1447.4+((KJ_RTM).100213-0103+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Backup+Server&LinkId=20476
System.Data.SqlClient.SqlError: The media loaded on "D:\Project 2014\PayrollBackup" is formatted to support 2 media families, but 1 media families are expected according to the backup device specification. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1447.4+((KJ_RTM).100213-0103+)&LinkId=20476
I just want to take a single backup of my database. But always I have to give two destinations and then when restoring I cant restore the database using a single backup file? Is there anything to configure in SSMS? If any, could you please clearly explain?
EDIT:
BACKUP DATABASE [Payroll] TO DISK = N'D:\Project 2014\PayrollBackup' WITH NOFORMAT, NOINIT, NAME = N'Payroll-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
A simple solution has arisen (via SSMS), based on the answer of #DMason and answer of #Carol Baker West.
Just create a new media set for a single media family.
The backup statement is using the NOINIT clause. This causes each successive backup to append to the existing backup file. You are attempting to backup to one media set (one file), but it appears the existing backup you are attempting to append to consisted of two media sets (two files).
For a quick turnaround, specify a new filename:
BACKUP DATABASE [Payroll] TO DISK = N'D:\Project 2014\<insert new filename>' WITH ...
The issue for me was there were two sources in the Destination.
After you backup with only one destination, removing the other. You don't get the error anymore.
Let me know if this helps!
I also received the error. In my case, I wanted to specify a different location to which the file should be backed up to. But what it was trying to do, was to now split the backup to both files in both locations - thus the part of the error:
is formatted to support 1 media families, but 2 media families are expected according to the backup device specification. (Microsoft.SqlServer.Smo)
So, remove one of the destinations specified in the 'Destination' section of the Back Up Database wizard. It should only have one destination if it only backed up to one file previously.
I got the same error with my project, so I did a couple of simple things:
Copied my old MyDB.bak file from the default backup path, say C:\Program Files\Microsoft SQL Server\MSSQL14.SQLEXPRESS\MSSQL\Backup
Removed it from there
Backed up new version of DB to the same path. (It now succeeded)
Copied the newly created backup to desired place.
When I was attempting to restore a backup onto another server, I got the same error that you got.
I was able to get past this error by deleting the "Backup Device" object and recreating a new one. As you know, the Backup Device is an object that saves a path to your backup folder and to the backup file. Apparently, it also saves other information like the media family.
In the SSMS interface, expand the Server Objects section, and then the Backup Devices section. Find the named backup device for the database and path that you are getting the error on. Delete that object and recreate it. That should take care of the issue.
Now, just so we are clear, I'm NOT talking about deleting the backup itself. I'm NOT talking about deleting or removing any drives. I'm NOT talking about deleting all of the backup devices listed on your server. I'm simply talking about deleting the backup device (which is an object) for one database on your server.
I received this message when I was adding a database to Always On Group and log backup failed with this message:
'The Backup cannot be performed because the existing media set is formatted with an incompatible version'
Problem: I was using the same backup shared folder as I was using two servers with multiple instances. Database was promoted from SQL Server 2008 R2 to SQL Server 2016. I did not delete the old 2008 R2 backups from that shared folder.
Solution: Try and clear out the old version backups and try again. It worked for me.

how to backup SQL database (tables, mappings, indices, etc.)

I am installing a service pack on our shopping cart. They recommend backing up the SQL database before installing. I know we have backups to tape drives done by our hosting company, but I want one I know the exact time stamp for and can access quickly if I need to reload it because of a goof during the upgrade. (I don't want to have the store down for any longer than needed.)
How do you recommend backing up a SQL database for easy reloading for someone who is used to just writing queries and stored procedures? (I'd like to get everything - mappings & indices, etc - because I wouldn't know what all of them are or how to recreate them.)
I access the database via Remote Desktop and can link my hard drive and DVD drives, if that helps. It's MSSQL 2008.
Thank you so much.
Best wishes,
Andrea
BACKUP DATABASE databasename TO DISK='C:\somefile.bak' WITH COPY_ONLY, INIT, FORMAT, CHECKSUM
Obviosly replace databasename and the target C:\somefile.bak as appropriate. Remember, the file and path is on the server; connecting remotely won't change where backup file is stored--in other words it won't be on your local machine.
You can omit the WITH options if you want. Drop INIT if you don't want the target .bak file overwritten. COPY_ONLY isn't a big deal either way in your case. CHECKSUM is just for validating the data before it gets backed up, and may not matter if you don't have CHECKSUMs turned on for the database--though by default starting in MS SQL 2005 new databases were.
The MS documentation for BACKUP and RESTORE isn't too difficult to understand in its basic forms. You can also use the Management Studio Tasks->Back Up or Tasks->Restore GUI if you have access to it.

SQL 2005 Moving from Godaddy SQL Server to a company owned server

What is the best way to go about moving a database from a Godaddy SQL 2005 account to a local SQL 2005 server? I have access to the DB through Server Management Studio Express and also through the Godaddy SQL explorer.
However, I have no idea where to start. In MySQL, I would just export the data through the PHPMyAdmin page, and conversely import it on the other server using an ASCII file. In access, I'd just use the migrate tool. In Server Management Studio, I've thought about using the "Backup" and "Restore" method, but I'm afraid that I won't have the ability to create a new object with the correct permission schema on the new server.
What are your thoughts? Keep in mind that I do not have access to the MDF or temp files. I've been studying this page.
SMSS should be able to do it for you. If you are looking to move the entire database and not just a few tables, the Backup and Restore method is probably your best bet.
Your steps might include:
connect to Godaddy sql server in ssms
Right click the database you want to move and select Tasks > Backup
Keep/set Backup type = "Full" and add a destination at the bottom that you will be able to access.
After backup completes, move the .bak file to a location that your local sql server can see.
Connect to your local sql server in ssms.
Right click Databases > Restore Database
Enter the database name you want in "To Database:"
Select "From device:" and locate the .bak file you created before.
In the row that shows up in the grid display, check the restore check box.
If it matters to you where the recreated files will be stored, select options on the top left menu and confirm the file locations under the "Restore As" column in the data grid.
Click ok and the restore should start.
To migrate users, follow the directions at http://support.microsoft.com/kb/918992
Don't be so afraid of the backup and restore. You have a much better chance at getting a high fidelity copy of your data than trying to roll your own. Give it a shot, test it out, and see what happens. I think you'll be pleasantly surprised.

Restoring two databases from a single backup file (SQL Server 2005)

I have a .bak file which contains backup sets of two different databases. It was made by sql server maintenance plan. Now I have to restore both databases. The problem is, that while the first database is restored ok (db_companies) the other database (db_data) gives an error:
Restore failed for Server 'SBSERVER'.
(Microsoft.SqlServer.Smo)
System.Data.SqlClient.SqlError:
Logical file 'CompaniesDB'
is not part of database 'DataDB'. Use
RESTORE FILELISTONLY to list the
logical file names.
(Microsoft.SqlServer.Smo)
The database restore wizards shows up both databases, and I select full and the lastest differential sets. The RESTORE FILELIST command show only the CompaniesDB. What's up with this?
I've also tried RESTORE DATABASE WITH MOVE but it doesn't recognize the DataDB logical name.
Is there any way to restore the DataDB from the backup set?
After doing some intensive research, I finally found out that this is a bug in sql server 2005. After I installed the SP3 everything went fine.
1)If you (in Management Studio), detach db_data, back up the existing mdf and log, then delete database completely, making sure the mdf and log are gone from their original DATA folder.
2)Then, right click on databases and go to "Restore Database"
3)Choose the source first! Go to "From Device" and browse to the .MDF
4)Now expand the drop down list with the heading "To Database" under the "Destination for Restore" section and choose db_data.
5)Click OK
6)It should restore fine, right click on it, go to properties and set the owner.
Note, this is me using MSSQL 08 but if memory serves me right there wasnt a drastic difference in management studio for 05.
Im sure someone else here knows a cleaner way, but the above will work.
The bak file may not have the backup of both databases.
Depending on your setup, it's one backup per file unless the file is actually a "device" and the backup did not initiase the device/file.

sql : How to move full text catalogue

I want to move full text catalogue for 1 database to a different location on same SQL server. I am using SQL 2005. One of the source said:
SQL Server 2005 full-text
search provides the ability to easily
detach and move full-text catalogs in
the same way that SQL Server database
files may be detached, moved, and
re-attached. Full-text catalogs are
included with sp_detach_db and
sp_attach_db. After detaching a
database, you may move the full-text
catalog and/or database data files,
and then re-attach the database.
Full-text catalog metadata is updated
to reflect the change of location.
This capability simplifies building,
testing, moving, and deploying
databases across multiple servers.
From:
http://msdn.microsoft.com/en-us/library/ms345119(SQL.90).aspx
Beleiving it, i only moved data and log file using attach and detach method, copied Full text catalog and rebuild it. Still
sp_help_fulltext_catalogs ''
shows same output with old path.
Another source:
http://sqlserverpedia.com/wiki/FTS_-Restoring&_Relocating_your_Catalogs
mentions Stopping and starting full text search service as a part of move. I can't restart full text service as it is being used by the other databases.
Is there any option using which I can move a single full text catalogue without restarting full text service?
Regards
Manjot
I didn't have to restart service at all..
I just tried it without restarting and it worked as per:
http://sqlserverpedia.com/wiki/FTS_-Restoring&_Relocating_your_Catalogs