Be careful when moving your TFS server across timezones

Our TFS server and two build servers were moved from the UK datacenter to the Amsterdam one this week, and a funny thing happened: I time-travelled into the future.

After the move I did a check-in to test if the migration was succesful: it was! However every check-in after that failed with:

TF54000: Cannot update data because the server clock may have been set incorrectly. Contact your Team Foundation Server Administrator.

After some googling I decided to have a look at the tbl_ChangeSet table. I ran

FROM tbl_ChangeSet
ORDER BY CreationDate DESC

and the result was a changeset one hour into the future! So when we tried to check-in changes to TFS it looked at the timestamp of the most recent changeset, compared it to timestamp of the new changeset, saw that it was older, and decided to throw an error that there must be a problem with the server time. I assume that sometime after my check-in the timezone of the server was updated.

Luckily after waiting for the time of the future changeset to arrive - one hour - we could check-in again.