TFS数据库服务器重映射操作遇到问题求助
It sounds like you've hit a snag while remapping your TFS databases to a new server. Let's start by recapping the steps you've already completed, then break down common issues and fixes for the TFSConfig RemapDBs command that's giving you trouble.
Your Completed Migration Steps
- Opened an elevated Command Prompt and navigated to:
C:\Program Files\Microsoft Team Foundation Server 12.0\Tools - Stopped TFS-related services with these commands:
IISRESET /stopTfsServiceControl quiesce
- Attempted to run the
TFSConfig RemapDBscommand to remap databases, but encountered issues.
Common Issues & Fixes for RemapDBs Failures
First, let's make sure you're using the correct command syntax for TFS 2013 (v12.0). The full command needs to specify both your old and new server details, and it's wise to use the /preview flag first to validate changes without making them:
TFSConfig RemapDBs /DatabaseName:New_Server_Name;Tfs_Configuration /SQLInstances:Old_Server_Name /AnalysisInstance:New_Analysis_Server_Name /AnalysisDatabaseName:New_Tfs_Analysis_DB /preview
If you're getting errors, check these key areas:
Missing Pre-Requisites
You can't remap databases unless you've already backed up all TFS databases from the old server (includingTfs_Configuration, collection databases, reporting/analysis databases) and restored them to the new SQL Server. Double-check that all databases are present and accessible on the new server.Permission Problems
Even with an elevated prompt, the account running the command needs sysadmin privileges on both the old and new SQL servers. It should also have permissions to modify TFS service settings. Verify the account's permissions if you're seeing access-denied errors.Incomplete Service Shutdown
TfsServiceControl quiescepauses jobs but might not stop all TFS services entirely. RunTfsServiceControl stopto fully terminate all TFS-related services, and confirm via the Services console thatVisual Studio Team Foundation Background Job Agentis stopped before re-running the remap command.Invalid Command Parameters
- Ensure
/DatabaseNameuses the formatNew_Server_Name;Tfs_Configuration(the configuration database is mandatory here). - Don't forget the
/SQLInstancesparameter pointing to your old server—this tells TFS which server to remap from. - If you're using TFS Reporting/Analysis, include those parameters only if you're moving those databases too.
- Ensure
Post-Remap Steps (Once the Command Succeeds)
After a successful remap, you'll need to:
- Restart IIS:
IISRESET /start - Start TFS services:
TfsServiceControl start - Open the TFS Administration Console to verify the application tier can connect to the new database server
- Test core TFS functionality (source control, work items, builds) to confirm everything works as expected
If you're seeing a specific error message (e.g., database not found, connection timeout), share the exact error text and we can narrow down the issue further!
内容的提问来源于stack exchange,提问作者Veejay

